Copy Array -> Use for loop with len
This commit is contained in:
parent
f8a7d1d634
commit
bdb693302a
|
@ -471,9 +471,13 @@ async function runtime(token: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [searchType, args] of [...Vencord.Webpack.webpackSearchHistory]) {
|
// Must evaluate the len outside of the loop, as the array will be modified by the find methods called inside of it
|
||||||
let method = searchType as string;
|
// This will avoid an infinite loop
|
||||||
|
const len = Vencord.Webpack.webpackSearchHistory.length;
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
|
const [searchType, args] = Vencord.Webpack.webpackSearchHistory[i];
|
||||||
|
|
||||||
|
let method = searchType as string;
|
||||||
if (searchType === "waitFor") method = "cacheFind";
|
if (searchType === "waitFor") method = "cacheFind";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue