diff --git a/ChangeLog b/ChangeLog index ef99bdd41..870e0bf61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-25 Richard Frith-Macdonald + + * Source/NSTimer.m: minor optimisation ... avoid unnecessary use of + autorelease by doing explicit release instead. + 2007-03-22 Richard Frith-Macdonald * Source/NSPathUtilities.m: NSTemporaryDirectory() don't raise diff --git a/Source/NSTimer.m b/Source/NSTimer.m index d30382b00..222de7cbe 100644 --- a/Source/NSTimer.m +++ b/Source/NSTimer.m @@ -150,10 +150,14 @@ static Class NSDate_class; invocation: (NSInvocation*)invocation repeats: (BOOL)f { - id t = [self timerWithTimeInterval: ti - invocation: invocation - repeats: f]; + id t = [[self alloc] initWithFireDate: nil + interval: ti + target: invocation + selector: NULL + userInfo: nil + repeats: f]; [[NSRunLoop currentRunLoop] addTimer: t forMode: NSDefaultRunLoopMode]; + RELEASE(t); return t; } @@ -171,12 +175,14 @@ static Class NSDate_class; userInfo: (id)info repeats: (BOOL)f { - id t = [self timerWithTimeInterval: ti - target: object - selector: selector - userInfo: info - repeats: f]; + id t = [[self alloc] initWithFireDate: nil + interval: ti + target: object + selector: selector + userInfo: info + repeats: f]; [[NSRunLoop currentRunLoop] addTimer: t forMode: NSDefaultRunLoopMode]; + RELEASE(t); return t; }