| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2b6a137 commit 993e204
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1063,11 +1063,7 @@ function populateStats(data) { | |||
| 1063 | 1063 | funcname = funcname || 'unknown'; | |
| 1064 | 1064 | ||
| 1065 | 1065 | if (filename !== 'unknown' && funcname !== 'unknown' && node.value > 0) { | |
| 1066 | - let childrenValue = 0; | ||
| 1067 | - if (node.children) { | ||
| 1068 | - childrenValue = node.children.reduce((sum, child) => sum + child.value, 0); | ||
| 1069 | - } | ||
| 1070 | - const directSamples = Math.max(0, node.value - childrenValue); | ||
| 1066 | + const directSamples = node.self || 0; | ||
| 1071 | 1067 | ||
| 1072 | 1068 | const funcKey = `${filename}:${node.lineno || '?'}:${funcname}`; | |
| 1073 | 1069 | ||
@@ -1345,14 +1341,13 @@ function processLeaf(invertedRoot, path, leafNode, isDifferential) { | |||
| 1345 | 1341 | } | |
| 1346 | 1342 | ||
| 1347 | 1343 | function traverseInvert(path, currentNode, invertedRoot, isDifferential) { | |
| 1348 | - const children = currentNode.children || []; | ||
| 1349 | - const childThreads = new Set(children.flatMap(c => c.threads || [])); | ||
| 1350 | - const selfThreads = (currentNode.threads || []).filter(t => !childThreads.has(t)); | ||
| 1344 | + const selfValue = currentNode.self || 0; | ||
| 1351 | 1345 | ||
| 1352 | - if (selfThreads.length > 0) { | ||
| 1353 | - processLeaf(invertedRoot, path, { ...currentNode, threads: selfThreads }, isDifferential); | ||
| 1346 | + if (selfValue > 0) { | ||
| 1347 | + processLeaf(invertedRoot, path, { ...currentNode, value: selfValue }, isDifferential); | ||
| 1354 | 1348 | } | |
| 1355 | 1349 | ||
| 1350 | + const children = currentNode.children || []; | ||
| 1356 | 1351 | children.forEach(child => traverseInvert(path.concat([child]), child, invertedRoot, isDifferential)); | |
| 1357 | 1352 | } | |
| 1358 | 1353 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments