JS: Add UselessRangeCheck.ql

This commit is contained in:
Asger F
2018-09-21 12:24:25 +01:00
parent d813635f3e
commit 344bec3865
8 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
function findValue(values, x, start, end) {
let i;
for (i = start; i < end; ++i) {
if (values[i] === x) {
return i;
}
}
if (i < end) {
return i;
}
return -1;
}