From 2da6c88fad982d9e48559bd2bbcc265e2def1b51 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Fri, 26 Jul 2013 02:08:14 -0400 Subject: [PATCH] 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. --- Foundation/CPTimer.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Foundation/CPTimer.j b/Foundation/CPTimer.j index 5f5284925..0dcc2a077 100644 --- a/Foundation/CPTimer.j +++ b/Foundation/CPTimer.j @@ -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;