Last modified: 2010-05-15 15:37:40 UTC
This is very minor, but might save a few femtoseconds. User.php, line 53 allocates a new User object, which isn't used until line 74. There are several paths where control may return from the method before that, in which case this relatively heavy object has been allocated unnecessarily. Remedy: move line 53 $u = new User(); to before line 74, making it $u = new User(); $u->setName( $canonicalName ); etc.
Created attachment 935 [details] Patch containing the proposed changes I've proposed a patch here, although I can see why this was done - it's good practise to declare variables and objects at the top of your functions. Then again, PHP is much more lenient with respect to variables, and even a small performance gain could be worth it.
(Patch is for CVS HEAD version)
still present in 1.5.0
Fixed in CVS HEAD
I'll sort out a patch for the 1.5 branch soon.