Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug in filter (bad propagation of node deletion)

  • Loading branch information...
commit 3f5d5002f2b6e4e33b55c14a1dc49d6e5f0c2623 1 parent d4fe4ed
@stevegury authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/main/scala/Profiler.scala
View
9 src/main/scala/Profiler.scala
@@ -97,11 +97,16 @@ object Profiler {
None
}
else {
+ // compute the newDescendants map by applying filter on each child
val newDescendants : Map[String,CallGraph] = descendants.values.flatMap{
_.filter(predicate, this :: callstack)
}.map{ g => (g.name,g) }(breakOut)
- val newCount = newDescendants.values.foldLeft(0){ case (sum,g) => sum + g.count }
- Some(new CallGraph(name, Runnable, newCount, newDescendants))
+ if( newDescendants.isEmpty )
+ None // propagate the callstack deletion
+ else{
+ val newCount = newDescendants.values.foldLeft(0){ case (sum,g) => sum + g.count }
+ Some(new CallGraph(name, Runnable, newCount, newDescendants))
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.