Skip to content

Commit 849bcee

Browse files
Optimize Event.stopObserving.
1 parent 7c26a1e commit 849bcee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/dom/event.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,14 @@
854854
});
855855
return element;
856856
}
857-
858-
var responder = responders.find( function(r) { return r.handler === handler; });
857+
858+
var i = responders.length, responder;
859+
while (i--) {
860+
if (responders[i].handler === handler) {
861+
responder = responders[i];
862+
break;
863+
}
864+
}
859865
if (!responder) return element;
860866

861867
if (eventName.include(':')) {

0 commit comments

Comments
 (0)