mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
WebUI: prefer range based for loop
Using `entries()` can also save the work of manually handling the index variable. PR #23182.
This commit is contained in:
@@ -772,9 +772,9 @@ window.qBittorrent.Search ??= (() => {
|
||||
};
|
||||
|
||||
const getPlugin = (name) => {
|
||||
for (let i = 0; i < searchPlugins.length; ++i) {
|
||||
if (searchPlugins[i].name === name)
|
||||
return searchPlugins[i];
|
||||
for (const searchPlugin of searchPlugins) {
|
||||
if (searchPlugin.name === name)
|
||||
return searchPlugin;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -877,8 +877,7 @@ window.qBittorrent.Search ??= (() => {
|
||||
|
||||
if (responseJSON.results) {
|
||||
const results = responseJSON.results;
|
||||
for (let i = 0; i < results.length; ++i) {
|
||||
const result = results[i];
|
||||
for (const result of results) {
|
||||
const row = {
|
||||
rowId: state.rowId,
|
||||
descrLink: result.descrLink,
|
||||
|
||||
Reference in New Issue
Block a user