mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-05-13 20:27:06 +02:00
fix: correct implementation of indexOf (#5)
LithoAdRemoval.indexOf never increments the index for the outer loop, causing an infinite loop
This commit is contained in:
parent
14c5d21f9d
commit
4da053804b
@ -188,14 +188,17 @@ public class LithoAdRemoval {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
for (int i = 0; i < array.length - target.length + 1; i++) {
|
||||||
while (i < array.length - target.length + 1 ){
|
boolean targetFound = true;
|
||||||
for (int j = 0; j < target.length; j++) {
|
for (int j = 0; j < target.length; j++) {
|
||||||
if (array[i+j] != target[j]) {
|
if (array[i+j] != target[j]) {
|
||||||
|
targetFound = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return i;
|
if (targetFound) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user