listeners order fix

This commit is contained in:
Dmitri Granetchi
2014-06-02 23:48:23 +03:00
parent f79373d7e5
commit 820144ceab
+2 -3
View File
@@ -187,11 +187,10 @@ class Signal<T> {
}
public function add(listener:T):Void {
if (listeners.indexOf(listener) == -1) {
checkLock();
var pos = listeners.indexOf(listener);
if (pos == -1) checkLock(); else listeners.splice(pos, 1);
listeners.push(listener);
}
}
public function remove(listener:T):Void {
var pos = listeners.indexOf(listener);