Update edge.cpp

improvement