diff options
| author | Thomas Voss <thomasvoss@live.com> | 2021-10-19 22:59:54 +0200 | 
|---|---|---|
| committer | Thomas Voss <thomasvoss@live.com> | 2021-10-19 22:59:54 +0200 | 
| commit | 9707d177f6edbb07709218fc89e9803f404f29b9 (patch) | |
| tree | 4dcbd09c092e67b3f9dca136bbf7397c7da5479b | |
| parent | d88a87260b98308b0f591bf376d29db95bf2420a (diff) | |
Instead of branching depending on the result of the predicate, you can
just assign the predicate directly to the `checked` variable.
| -rw-r--r-- | settings.js | 5 | 
1 files changed, 1 insertions, 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")) |