class StackProf::Report

def normalized_frames

def normalized_frames
  id2hash = {}
  @data[:frames].each do |frame, info|
    id2hash[frame.to_s] = info[:hash] = Digest::SHA256.hexdigest("#{info[:name]}#{info[:file]}#{info[:line]}")
  end
  @data[:frames].inject(Hash.new) do |hash, (frame, info)|
    info = hash[id2hash[frame.to_s]] = info.dup
    info[:edges] = info[:edges].inject(Hash.new){ |edges, (edge, weight)| edges[id2hash[edge.to_s]] = weight; edges } if info[:edges]
    hash
  end
end