Fixed: constant name was misleading.

Previously CPTimerMinTimeInterval was used as a constant for the *default* time interval used when a timer was initialized with an interval <= 0. It isn't the minimum, it is possible to create a timer with an interval less than that constant's value.

The name has been changed to CPTimerDefaultTimeInterval to make it clearer what it's purpose is. It has also been changed to a #define, that will result in smaller generated code.
This commit is contained in:
Aparajita Fishman
2013-07-26 02:08:14 -04:00
parent b03e354dbf
commit 2da6c88fad
+3 -3
View File
@@ -25,7 +25,7 @@
@import "CPObject.j"
@import "CPRunLoop.j"
var CPTimerMinTimeInterval = 0.1;
#define CPTimerDefaultTimeInterval 0.1
/*!
@class CPTimer
@@ -114,7 +114,7 @@ var CPTimerMinTimeInterval = 0.1;
if (self)
{
_timeInterval = (seconds <= 0) ? CPTimerMinTimeInterval : seconds;
_timeInterval = (seconds <= 0) ? CPTimerDefaultTimeInterval : seconds;
_invocation = anInvocation;
_repeats = shouldRepeat;
_isValid = YES;
@@ -152,7 +152,7 @@ var CPTimerMinTimeInterval = 0.1;
if (self)
{
_timeInterval = (seconds <= 0) ? CPTimerMinTimeInterval : seconds;
_timeInterval = (seconds <= 0) ? CPTimerDefaultTimeInterval : seconds;
_callback = aFunction;
_repeats = shouldRepeat;
_isValid = YES;