PleaseStand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/80532


Change subject: Profiler: remove unnecessary function calls
......................................................................

Profiler: remove unnecessary function calls

Should slightly reduce overhead.

Change-Id: Iff71041f1cbc12b0d28f24752a01c63456cb9eaf
---
M includes/profiler/Profiler.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/80532/1

diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php
index 5346c34..41a9d60 100644
--- a/includes/profiler/Profiler.php
+++ b/includes/profiler/Profiler.php
@@ -34,8 +34,8 @@
        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 @@
        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 @@
                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 );
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/80532
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff71041f1cbc12b0d28f24752a01c63456cb9eaf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to