From 9707d177f6edbb07709218fc89e9803f404f29b9 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 19 Oct 2021 22:59:54 +0200 Subject: Simplify check for removing titles Instead of branching depending on the result of the predicate, you can just assign the predicate directly to the `checked` variable. --- settings.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/settings.js b/settings.js index 5c20ec1..fd05a29 100644 --- a/settings.js +++ b/settings.js @@ -48,10 +48,7 @@ function remove_titles() checked = document.getElementById("page_titles").checked; } catch { /* Index page */ - if (localStorage.getItem("remove_titles") === "true") - checked = true; - else - checked = false; + checked = (localStorage.getItem("remove_titles") === "true"); } if (checked && !window.location.href.endsWith("settings.html")) -- cgit v1.2.3