Update graph.cc

Avoid few copies