Skip to content

Commit 08467be

Browse files
Atsumu Onominggo
authored andcommitted
Add const keyward to Node::isScheduled and Scheduler::isScheduled (#17833)
1 parent 95baff7 commit 08467be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cocos/base/CCScheduler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void Scheduler::schedulePerFrame(const ccSchedulerFunc& callback, void *target,
500500
}
501501
}
502502

503-
bool Scheduler::isScheduled(const std::string& key, void *target)
503+
bool Scheduler::isScheduled(const std::string& key, void *target) const
504504
{
505505
CCASSERT(!key.empty(), "Argument key must not be empty");
506506
CCASSERT(target, "Argument target must be non-nullptr");
@@ -1003,7 +1003,7 @@ void Scheduler::schedule(SEL_SCHEDULE selector, Ref *target, float interval, boo
10031003
this->schedule(selector, target, interval, CC_REPEAT_FOREVER, 0.0f, paused);
10041004
}
10051005

1006-
bool Scheduler::isScheduled(SEL_SCHEDULE selector, Ref *target)
1006+
bool Scheduler::isScheduled(SEL_SCHEDULE selector, Ref *target) const
10071007
{
10081008
CCASSERT(selector, "Argument selector must be non-nullptr");
10091009
CCASSERT(target, "Argument target must be non-nullptr");

cocos/base/CCScheduler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,15 @@ class CC_DLL Scheduler : public Ref
363363
@return True if the specified callback is invoked, false if not.
364364
@since v3.0.0
365365
*/
366-
bool isScheduled(const std::string& key, void *target);
366+
bool isScheduled(const std::string& key, void *target) const;
367367

368368
/** Checks whether a selector for a given target is scheduled.
369369
@param selector The selector to be checked.
370370
@param target The target of the callback.
371371
@return True if the specified selector is invoked, false if not.
372372
@since v3.0
373373
*/
374-
bool isScheduled(SEL_SCHEDULE selector, Ref *target);
374+
bool isScheduled(SEL_SCHEDULE selector, Ref *target) const;
375375

376376
/////////////////////////////////////
377377

0 commit comments

Comments
 (0)