From: Alexandre Emsenhuber Date: Thu, 29 Mar 2012 15:59:43 +0000 (+0200) Subject: Remove some duplicate code in ProfilerSimpleTrace X-Git-Tag: 1.31.0-rc.0~24028^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=16b8d33ae82fbc0787a4610b8ef873f37f027507;p=lhc%2Fweb%2Fwiklou.git Remove some duplicate code in ProfilerSimpleTrace Change-Id: Iab0b5343dbbd50419ba31724513b062f682c98df --- diff --git a/includes/profiler/ProfilerSimpleTrace.php b/includes/profiler/ProfilerSimpleTrace.php index 57fbb6feab..7602f06349 100644 --- a/includes/profiler/ProfilerSimpleTrace.php +++ b/includes/profiler/ProfilerSimpleTrace.php @@ -10,20 +10,11 @@ * @ingroup Profiler */ class ProfilerSimpleTrace extends ProfilerSimple { - var $trace = ""; + var $trace = "Beginning trace: \n"; var $memory = 0; - function addInitialStack() { - $initialTime = $this->getInitialTime(); - $initialCpu = $this->getInitialTime( 'cpu' ); - if ( $initialTime !== null && $initialCpu !== null ) { - $this->mWorkStack[] = array( '-total', 0, $initialTime, $initialCpu ); - } - $this->trace .= "Beginning trace: \n"; - } - - function profileIn($functionname) { - $this->mWorkStack[] = array( $functionname, count( $this->mWorkStack ), $this->getTime(), $this->getTime( 'cpu' ) ); + function profileIn( $functionname ) { + parent::profileIn( $functionname ); $this->trace .= " " . sprintf("%6.1f",$this->memoryDiff()) . str_repeat( " ", count($this->mWorkStack)) . " > " . $functionname . "\n"; }