mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 981370 - Make MousePosTracker use a Set rather than manage an array itself. r=dao
This commit is contained in:
parent
49df72459f
commit
71af330624
@ -7097,7 +7097,7 @@ XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function () {
|
||||
});
|
||||
|
||||
var MousePosTracker = {
|
||||
_listeners: [],
|
||||
_listeners: new Set(),
|
||||
_x: 0,
|
||||
_y: 0,
|
||||
get _windowUtils() {
|
||||
@ -7106,21 +7106,17 @@ var MousePosTracker = {
|
||||
},
|
||||
|
||||
addListener: function (listener) {
|
||||
if (this._listeners.indexOf(listener) >= 0)
|
||||
if (this._listeners.has(listener))
|
||||
return;
|
||||
|
||||
listener._hover = false;
|
||||
this._listeners.push(listener);
|
||||
this._listeners.add(listener);
|
||||
|
||||
this._callListener(listener);
|
||||
},
|
||||
|
||||
removeListener: function (listener) {
|
||||
var index = this._listeners.indexOf(listener);
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
this._listeners.splice(index, 1);
|
||||
this._listeners.delete(listener);
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
|
Loading…
Reference in New Issue
Block a user