Permalink
Browse files

fix bug in count calculation when merging graphs

  • Loading branch information...
1 parent 3f5d500 commit 7ce788581143a52b9d621579850104fc23b45a22 @stevegury committed Jun 1, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/main/scala/Profiler.scala
View
3 src/main/scala/Profiler.scala
@@ -82,7 +82,8 @@ object Profiler {
case None => (name,node)
}
} ++ (smallest -- biggest.keys) // add node only present in smallest descendant list
- new CallGraph(name, Runnable, count + graph.count, newDescendants )
+ val newCount = newDescendants.values.foldLeft(0){ case (sum,g) => sum + g.count }
+ new CallGraph(name, Runnable, newCount, newDescendants )
}
else // in case of root inequality, return a new node with the two graphs as children
new CallGraph(name + "#" + graph.name, Runnable, count + graph.count, Map(name -> this, graph.name -> graph))

0 comments on commit 7ce7885

Please sign in to comment.