|
From: | Lars Sonchocky-Helldorf |
Subject: | Re: Problem with NSString |
Date: | Sun, 30 Jan 2011 18:44:24 +0100 |
Am 30.01.2011 um 18:16 schrieb David Chisnall:
On 30 Jan 2011, at 16:51, Ivan Vučica wrote:while(![@"Quit" isEqualToString:word2]) or while(![word2 isEqualToString:@"Quit"])Straying wildly off-topic, but the first form is preferable from the compiler's point of view. It means that the class of the receiver is known at compile time, which means that we can have a better stab at speculative inlining.
And not only that. It is also a good practice of defensive coding, e.g. you don't run into problems if word2 happens to be Nil.
This is currently only done in an experimental optimisation pass on my machine, but it will probably become one of the standard Objective-C passes used by clang for the GNUstep runtime sometime this year.
Great! I am looking forward to this.
David
cheers, Lars
[Prev in Thread] | Current Thread | [Next in Thread] |