mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
cleanup: Use Array.includes() to check for element existence
We can use that newer method where we don't care about the actual position of an element inside the array. (Array.includes() and Array.indexOf() do behave differently in edge cases, for example in the handling of NaN, but those don't matter to us) https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/152
This commit is contained in:
parent
b87455c089
commit
f6b4b96737
29 changed files with 49 additions and 50 deletions
|
|
@ -146,10 +146,10 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
|||
|
||||
if (provider.defaultEnabled) {
|
||||
let disabled = searchSettings.get_strv('disabled');
|
||||
return disabled.indexOf(appId) == -1;
|
||||
return !disabled.includes(appId);
|
||||
} else {
|
||||
let enabled = searchSettings.get_strv('enabled');
|
||||
return enabled.indexOf(appId) != -1;
|
||||
return enabled.includes(appId);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue