mirror of
https://github.com/github/codeql.git
synced 2026-03-30 20:28:15 +02:00
JS: Add UselessRangeCheck.ql
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user