jenkins-bot has submitted this change and it was merged.

Change subject: Profiler: remove unnecessary checks Should slightly reduce 
overhead.
......................................................................


Profiler: remove unnecessary checks
Should slightly reduce overhead.

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

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: Iff71041f1cbc12b0d28f24752a01c63456cb9eaf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to