From: Kevin Israel Date: Fri, 23 Aug 2013 07:11:14 +0000 (-0400) Subject: Profiler: remove unnecessary checks X-Git-Tag: 1.31.0-rc.0~18876^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/message.php?a=commitdiff_plain;h=0643e83df7453ea9e2fd09984e85d11a4c8c7270;p=lhc%2Fweb%2Fwiklou.git Profiler: remove unnecessary checks Should slightly reduce overhead. Change-Id: Iff71041f1cbc12b0d28f24752a01c63456cb9eaf --- diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index 5346c3485a..41a9d60141 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -34,8 +34,8 @@ function wfProfileIn( $functionname ) { if ( Profiler::$__instance === null ) { // use this directly to reduce overhead Profiler::instance(); } - if ( Profiler::$__instance && !( Profiler::$__instance instanceof ProfilerStub ) ) { - Profiler::instance()->profileIn( $functionname ); + if ( !( Profiler::$__instance instanceof ProfilerStub ) ) { + Profiler::$__instance->profileIn( $functionname ); } } @@ -47,8 +47,8 @@ function wfProfileOut( $functionname = 'missing' ) { if ( Profiler::$__instance === null ) { // use this directly to reduce overhead Profiler::instance(); } - if ( Profiler::$__instance && !( Profiler::$__instance instanceof ProfilerStub ) ) { - Profiler::instance()->profileOut( $functionname ); + if ( !( Profiler::$__instance instanceof ProfilerStub ) ) { + Profiler::$__instance->profileOut( $functionname ); } } @@ -77,7 +77,7 @@ class ProfileSection { if ( Profiler::$__instance === null ) { // use this directly to reduce overhead Profiler::instance(); } - if ( Profiler::$__instance && !( Profiler::$__instance instanceof ProfilerStub ) ) { + if ( !( Profiler::$__instance instanceof ProfilerStub ) ) { $this->enabled = true; Profiler::$__instance->profileIn( $this->name ); }