r44853 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44852‎ | r44853 | r44854 >
Date:18:50, 20 December 2008
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Performance tweak
Modified paths:
  • /trunk/extensions/Configure/Configure.obj.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.obj.php
@@ -79,7 +79,9 @@
8080 }
8181
8282 public function snapshotDefaults( /* options */ ) {
83 - wfProfileIn( __METHOD__ );
 83+ static $loaded = false;
 84+ if( $loaded ) return;
 85+ $loaded = true;
8486 $options = func_get_args();
8587 $noOverride = in_array( 'no_override', $options );
8688 if( !is_array($this->mDefaults) || in_array('allow_empty',$options) ) {
@@ -95,7 +97,6 @@
9698 }
9799 }
98100 }
99 - wfProfileOut( __METHOD__ );
100101 }
101102
102103 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r44890Revert r44853 per codereviewaaron07:04, 22 December 2008

Comments

#Comment by IAlex (talk | contribs)   19:09, 20 December 2008

Hmm, this function is called twice, one time in efConfigureSetup() and the second time in WebConfiguration::extract(). As far as I can see, the second call is to take remaining vars that are initialized in Setup.php (such as $wgLogo and other things depending on $wgScriptPath, etc.), so I don't know if it's good to short-circuit the second call.

#Comment by Aaron Schulz (talk | contribs)   07:41, 22 December 2008

Reverted in r44890

Status & tagging log