/* Find all items under this entry */
$level = $stack[$max][1];
$working = [];
- for ( $i = $max -1; $i >= 0; $i-- ) {
+ for ( $i = $max - 1; $i >= 0; $i-- ) {
if ( $stack[$i][1] > $level ) {
$working[] = $stack[$i];
} else {
protected function calltreeCount( $stack, $start ) {
$level = $stack[$start][1];
$count = 0;
- for ( $i = $start -1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {
- $count ++;
+ for ( $i = $start - 1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {
+ $count++;
}
return $count;
}
}
}
}
-
-/**
- * Subclass ScopedCallback to avoid call_user_func_array(), which is slow
- *
- * This class should not be used outside of SectionProfiler
- */
-class SectionProfileCallback extends ScopedCallback {
- /** @var SectionProfiler */
- protected $profiler;
- /** @var string */
- protected $section;
-
- /**
- * @param SectionProfiler $profiler
- * @param string $section
- */
- public function __construct( SectionProfiler $profiler, $section ) {
- parent::__construct( null );
- $this->profiler = $profiler;
- $this->section = $section;
- }
-
- function __destruct() {
- $this->profiler->profileOutInternal( $this->section );
- }
-}