Skip to content

Commit 34715e7

Browse files
author
pandamicro
committed
Unify Scheduler:isScheduled behavior with JSB
1 parent 2ff174e commit 34715e7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cocos2d/core/CCScheduler.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -768,26 +768,27 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
768768
}
769769
},
770770

771-
isScheduled: function(key, target){
771+
isScheduled: function(callback, target){
772772
//key, target
773773
//selector, target
774-
cc.assert(key, "Argument key must not be empty");
774+
cc.assert(callback, "Argument callback must not be empty");
775775
cc.assert(target, "Argument target must be non-nullptr");
776776

777-
var element = this._hashForUpdates[target.__instanceId];
777+
var element = this._hashForTimers[target.__instanceId];
778778

779-
if (!element){
779+
if (!element) {
780780
return false;
781781
}
782782

783783
if (element.timers == null){
784784
return false;
785-
}else{
785+
}
786+
else {
786787
var timers = element.timers;
787-
for (var i = 0; i < timers.length; ++i){
788+
for (var i = 0; i < timers.length; ++i) {
788789
var timer = timers[i];
789790

790-
if (key === timer.getKey()){
791+
if (callback === timer._selector){
791792
return true;
792793
}
793794
}

0 commit comments

Comments
 (0)