Skip to content

Commit eaf513d

Browse files
committed
minor changes to the setInterval
1 parent de1fd65 commit eaf513d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Thread.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@ void Thread::runned(long time){
2525
_cached_next_run = last_run + interval;
2626
}
2727

28-
Thread Thread::setInterval(long _interval){
28+
void Thread::setInterval(long _interval){
2929
// Filter intervals less than 0
3030
interval = (_interval < 0? 0: _interval);
3131

3232
// Cache the next run based on the last_run
3333
_cached_next_run = last_run + interval;
34-
35-
// Return self object
36-
return *this;
3734
}
3835

3936
bool Thread::shouldRun(long time){

Thread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Thread{
4040
Thread(void (*callback)(void) = NULL, long _interval = 0);
4141

4242
// Set the desired interval for calls, and update _cached_next_run
43-
virtual Thread setInterval(long _interval);
43+
virtual void setInterval(long _interval);
4444

4545
// Return if the Thread should be runned or not
4646
virtual bool shouldRun(long time = -1);

0 commit comments

Comments
 (0)