From d29479e93370b577adeeb133116ced99dc4f81ff Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Thu, 5 Jan 2017 13:38:51 -0500 Subject: Refactor - Reorder includes - Unify reference style - Improve whitespace --- src/parse.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/parse.h') diff --git a/src/parse.h b/src/parse.h index 1d37083..31fa7c6 100644 --- a/src/parse.h +++ b/src/parse.h @@ -2,9 +2,9 @@ #define PARSE_H #include -#include #include #include + #include "graph.h" class Parser { @@ -17,7 +17,7 @@ public: graph_.sort_vertices(); } - const Graph & get_graph() { + const Graph& get_graph() { return graph_; } private: @@ -25,9 +25,11 @@ private: std::ifstream input_file_; void parse_edge_(std::string edge) { - int from, to; std::stringstream sstream(edge); + + int from, to; sstream >> from >> to; + graph_.add_edge(from, to); } }; -- cgit v1.2.3