From 0643e83df7453ea9e2fd09984e85d11a4c8c7270 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Fri, 23 Aug 2013 03:11:14 -0400 Subject: [PATCH] Profiler: remove unnecessary checks Should slightly reduce overhead. Change-Id: Iff71041f1cbc12b0d28f24752a01c63456cb9eaf --- includes/profiler/Profiler.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 ); } -- 2.20.1