m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-01-04 14:05:20 -0500
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-01-04 14:05:20 -0500
commit308c1fe093a3277ec74a7c0c4bf8934b7e22002b (patch)
tree5bf0f7ef4bd1f772864def2d4c73d26fef7c737e
parent8c8ef97f056e268b0d186a218e61e98df1df4733 (diff)
Return Graph by const reference
-rw-r--r--src/brandes.cc2
-rw-r--r--src/parse.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/brandes.cc b/src/brandes.cc
index 7c7d529..809ccd4 100644
--- a/src/brandes.cc
+++ b/src/brandes.cc
@@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
Parser parser(input_file);
- Graph graph = parser.get_graph();
+ const Graph &graph = parser.get_graph();
return 0;
}
diff --git a/src/parse.h b/src/parse.h
index 3f86eec..ec86302 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -15,7 +15,7 @@ public:
}
}
- Graph get_graph() {
+ const Graph & get_graph() {
return graph_;
}
private: