1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Optimize for loops

This commit is contained in:
Chris 2021-01-24 16:26:14 -06:00 committed by GitHub
parent 1b4bc83d24
commit 774aa45ae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -516,9 +516,7 @@ import Headroom from 'headroom.js';
} }
function hasUnsortedPlugins(pluginItems) { function hasUnsortedPlugins(pluginItems) {
for (let i = 0, length = pluginItems.length; i < length; i++) { for (const pluginItem of pluginItems) {
const pluginItem = pluginItems[i];
if (pluginItem.EnableInMainMenu && pluginItem.MenuSection === undefined) { if (pluginItem.EnableInMainMenu && pluginItem.MenuSection === undefined) {
return true; return true;
} }
@ -527,9 +525,7 @@ import Headroom from 'headroom.js';
} }
function addPluginPagesToMainMenu(links, pluginItems, section) { function addPluginPagesToMainMenu(links, pluginItems, section) {
for (let i = 0, length = pluginItems.length; i < length; i++) { for (const pluginItem of pluginItems) {
const pluginItem = pluginItems[i];
if (pluginItem.EnableInMainMenu && pluginItem.MenuSection === section) { if (pluginItem.EnableInMainMenu && pluginItem.MenuSection === section) {
links.push({ links.push({
name: pluginItem.DisplayName, name: pluginItem.DisplayName,