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 );
}
}
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 );
}
}
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 );
}
return; // short-circuit
// @TODO: hardcoded check is a tad janky (what about FOR UPDATE?)
} elseif ( !preg_match( '/^query-m: (?!SELECT)/', $method )
- && $realtime < $this->mDBLockThreshold )
- {
+ && $realtime < $this->mDBLockThreshold
+ ) {
return; // not a DB master query nor slow enough
}
$now = microtime( true );
$prof .= sprintf( $format,
substr( $fname, 0, $nameWidth ),
$calls,
- (float) ( $elapsed * 1000 ),
- (float) ( $elapsed * 1000 ) / $calls,
+ (float)( $elapsed * 1000 ),
+ (float)( $elapsed * 1000 ) / $calls,
$percent,
$memory,
( $this->mMin[$fname] * 1000.0 ),
foreach ( $this->mCollated as $name => $elapsed ) {
$eventCount = $this->mCalls[$name];
- $timeSum = (float) ( $elapsed * 1000 );
+ $timeSum = (float)( $elapsed * 1000 );
$memorySum = (float)$this->mMemory[$name];
$name = substr( $name, 0, 255 );