diff --git a/Foundation/CPString.j b/Foundation/CPString.j index f72f6af15..c7468c685 100644 --- a/Foundation/CPString.j +++ b/Foundation/CPString.j @@ -90,10 +90,7 @@ var CPStringHashes = new objj_dictionary(); */ + (id)stringWithHash:(unsigned)aHash { - var zeros = "000000", - digits = aHash.toString(16); - - return zeros.substring(0, zeros.length - digits.length) + digits; + return sprintf("%06x", aHash); } /*! diff --git a/Foundation/CPTimer.j b/Foundation/CPTimer.j index c564f84a5..ab36138a1 100644 --- a/Foundation/CPTimer.j +++ b/Foundation/CPTimer.j @@ -249,7 +249,7 @@ var _CPTimerBridgeTimer = function(codeOrFunction, aDelay, shouldRepeat, functio if (!functionArgs) functionArgs = []; - theFunction = function() { codeOrFunction.apply(window, functionArgs); CPTimersForTimeoutIDs[timeoutID] = nil;} + theFunction = function() { codeOrFunction.apply(window, functionArgs); CPTimersForTimeoutIDs[timeoutID] = nil; } } CPTimersForTimeoutIDs[timeoutID] = [CPTimer scheduledTimerWithTimeInterval:aDelay / 1000 callback:theFunction repeats:shouldRepeat]; diff --git a/Tools/nib2cib/NSNibConnector.j b/Tools/nib2cib/NSNibConnector.j index 7216286e4..40ace7d2e 100644 --- a/Tools/nib2cib/NSNibConnector.j +++ b/Tools/nib2cib/NSNibConnector.j @@ -49,7 +49,7 @@ - (id)initWithCoder:(CPCoder)aCoder { - return [[_CPCibConnector alloc] NS_initWithCoder:aCoder]; + return [self NS_initWithCoder:aCoder]; } - (Class)classForKeyedArchiver @@ -65,7 +65,7 @@ - (id)initWithCoder:(CPCoder)aCoder { - return [[_CPCibControlConnector alloc] NS_initWithCoder:aCoder]; + return [self NS_initWithCoder:aCoder]; } - (Class)classForKeyedArchiver @@ -81,7 +81,7 @@ - (id)initWithCoder:(CPCoder)aCoder { - return [[_CPCibOutletConnector alloc] NS_initWithCoder:aCoder]; + return [self NS_initWithCoder:aCoder]; } - (Class)classForKeyedArchiver diff --git a/Tools/nib2cib/NSView.j b/Tools/nib2cib/NSView.j index 2c54fbf14..dab3c6b88 100644 --- a/Tools/nib2cib/NSView.j +++ b/Tools/nib2cib/NSView.j @@ -90,7 +90,7 @@ - (id)initWithCoder:(CPCoder)aCoder { - return [[CPView alloc] NS_initWithCoder:aCoder]; + return [self NS_initWithCoder:aCoder]; } - (Class)classForKeyedArchiver