cleanup: Use type-safe comparisons

We have been using type-safe comparisons in new code for quite a while
now, however old code has only been adapted slowly.

Change all the remaining bits to get rid of another legacy style
difference.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
This commit is contained in:
Florian Müllner
2023-08-07 02:51:19 +02:00
committed by Marge Bot
parent 9a3913d4a0
commit a42f7c2384
94 changed files with 847 additions and 845 deletions

View File

@ -67,7 +67,7 @@ class PointerWatcher {
_removeWatch(watch) {
for (let i = 0; i < this._watches.length; i++) {
if (this._watches[i] == watch) {
if (this._watches[i] === watch) {
this._watches.splice(i, 1);
this._updateTimeout();
return;
@ -93,7 +93,7 @@ class PointerWatcher {
this._timeoutId = 0;
}
if (this._idle || this._watches.length == 0)
if (this._idle || this._watches.length === 0)
return;
let minInterval = this._watches[0].interval;
@ -112,7 +112,7 @@ class PointerWatcher {
_updatePointer() {
let [x, y] = global.get_pointer();
if (this.pointerX == x && this.pointerY == y)
if (this.pointerX === x && this.pointerY === y)
return;
this.pointerX = x;
@ -121,7 +121,7 @@ class PointerWatcher {
for (let i = 0; i < this._watches.length;) {
let watch = this._watches[i];
watch.callback(x, y);
if (watch == this._watches[i]) // guard against self-removal
if (watch === this._watches[i]) // guard against self-removal
i++;
}
}