lib/flamegraph/renderer.rb in flamegraph-0.0.5 vs lib/flamegraph/renderer.rb in flamegraph-0.0.6

- old
+ new

@@ -20,17 +20,18 @@ body.sub!("/**DATA**/", ::JSON.generate(graph_data)); body end def graph_data - height = 0 - table = [] prev = [] # a 2d array makes collapsing easy @stacks.each_with_index do |stack, pos| + + next unless stack + col = [] stack.reverse.map{|r| r.to_s}.each_with_index do |frame, i| if !prev[i].nil? @@ -77,10 +78,10 @@ end out end def read(file) - body = IO.read(::File.expand_path(file, ::File.dirname(__FILE__))) + IO.read(::File.expand_path(file, ::File.dirname(__FILE__))) end end