WebUI: prefer for loop over Array.forEach method

The `for` loop can do everything `forEach` can and doesn't need a closure.
This commit is contained in:
Chocobo1
2025-08-24 18:34:10 +08:00
parent 2be052e9c4
commit 6ac0c5a8b8
12 changed files with 58 additions and 59 deletions

View File

@@ -725,9 +725,8 @@ window.qBittorrent.Search ??= (() => {
if (prevSearchPluginsResponse !== responseJSON) {
prevSearchPluginsResponse = responseJSON;
searchPlugins.length = 0;
responseJSON.forEach((plugin) => {
for (const plugin of responseJSON)
searchPlugins.push(plugin);
});
const pluginOptions = [];
pluginOptions.push(createOption("QBT_TR(Only enabled)QBT_TR[CONTEXT=SearchEngineWidget]", "enabled"));