From 5099663c3707444d5d5e22b0404d521ebb29174d Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 6 Jul 2018 01:55:04 +0900 Subject: [PATCH] Use early continue style --- scripts/Actions/Explore.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/Actions/Explore.ts b/scripts/Actions/Explore.ts index cf553f97..3a3ac81a 100644 --- a/scripts/Actions/Explore.ts +++ b/scripts/Actions/Explore.ts @@ -41,12 +41,14 @@ export function toggleHideAddedAnime(arn: AnimeNotifier, input: HTMLButtonElemen // Hides anime that are already in your list. export function hideAddedAnime() { for(let anime of findAll("anime-grid-cell")) { - if(anime.dataset.added === "true") { - if(localStorage.getItem("hide-added-anime") === "true") { - anime.classList.add("anime-grid-cell-hide") - } else { - anime.classList.remove("anime-grid-cell-hide") - } + if(anime.dataset.added !== "true") { + continue + } + + if(localStorage.getItem("hide-added-anime") === "true") { + anime.classList.add("anime-grid-cell-hide") + } else { + anime.classList.remove("anime-grid-cell-hide") } } }