summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlpha <ngcoder@live.com>2015-07-28 15:29:24 -0400
committerAlpha <ngcoder@live.com>2015-07-28 15:29:24 -0400
commit12c8f8f96bc885dc8c43154f3edaf94340175909 (patch)
treeedfb48d81333475339ed08df4bc09f1a2df13f11
parent255532f693ab94c77d10abc00ff9f9a2a91cbca7 (diff)
downloadwebgrind-12c8f8f96bc885dc8c43154f3edaf94340175909.zip
webgrind-12c8f8f96bc885dc8c43154f3edaf94340175909.tar.gz
webgrind-12c8f8f96bc885dc8c43154f3edaf94340175909.tar.bz2
Fix save correct called-from function index
Introduced in c64e82b
-rw-r--r--library/Preprocessor.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/Preprocessor.php b/library/Preprocessor.php
index 1366848..9121dd5 100644
--- a/library/Preprocessor.php
+++ b/library/Preprocessor.php
@@ -102,7 +102,7 @@ class Webgrind_Preprocessor
$calledIndex = $functionNames[$calledFunctionName];
$key = $index.$lnr;
if (!isset($functions[$calledIndex]['calledFromInformation'][$key])) {
- $functions[$calledIndex]['calledFromInformation'][$key] = array('line'=>$lnr,'callCount'=>0,'summedCallCost'=>0);
+ $functions[$calledIndex]['calledFromInformation'][$key] = array('functionNr'=>$index,'line'=>$lnr,'callCount'=>0,'summedCallCost'=>0);
}
$functions[$calledIndex]['calledFromInformation'][$key]['callCount']++;
@@ -137,7 +137,7 @@ class Webgrind_Preprocessor
fwrite($out, pack(self::NR_FORMAT.'*', $function['line'], $function['summedSelfCost'], $function['summedInclusiveCost'], $function['invocationCount'], $calledFromCount, $subCallCount));
// Write called from information
foreach ((array)$function['calledFromInformation'] as $call) {
- fwrite($out, pack(self::NR_FORMAT.'*', $index, $call['line'], $call['callCount'], $call['summedCallCost']));
+ fwrite($out, pack(self::NR_FORMAT.'*', $call['functionNr'], $call['line'], $call['callCount'], $call['summedCallCost']));
}
// Write sub call information
foreach ((array)$function['subCallInformation'] as $call) {