diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-09-11 19:40:56 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-09-11 19:40:56 +0000 |
commit | b9ca395bdade623ccfc58e92a98e90bf7eae6f17 (patch) | |
tree | 07fd76ed69516caac65bc72f0a4e05419d4d9065 /src | |
parent | 5fb66b3c664b2343776b97327c4bde9eb6c69351 (diff) |
Code review: constify find_child and for instead of while loop
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/graph_expansion_with_blocker_oracle@2657 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: e136c1a8b6d5bbc213383f1e6a2e00a875424ad1
Diffstat (limited to 'src')
-rw-r--r-- | src/Simplex_tree/include/gudhi/Simplex_tree.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index f7df277c..f48dd048 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -1124,9 +1124,8 @@ class Simplex_tree { return; // Reverse loop starting before the last one for 'next' to be the last one for (auto simplex = siblings->members().rbegin() + 1; simplex != siblings->members().rend(); simplex++) { - auto next = siblings->members().rbegin(); std::vector<std::pair<Vertex_handle, Node> > intersection; - while(next != simplex) { + for(auto next = siblings->members().rbegin(); next != simplex; next++) { bool to_be_inserted = true; Filtration_value filt = simplex->second.filtration(); // If all the boundaries are present, 'next' needs to be inserted @@ -1141,8 +1140,6 @@ class Simplex_tree { if (to_be_inserted) { intersection.emplace_back(next->first, Node(nullptr, filt)); } - // loop until simplex is reached - next++; } if (intersection.size() != 0) { // Reverse the order to insert @@ -1183,7 +1180,7 @@ class Simplex_tree { * Vertex_handle. * Returns null_simplex() if it does not exist */ - Simplex_handle find_child(Simplex_handle sh, Vertex_handle vh) { + Simplex_handle find_child(Simplex_handle sh, Vertex_handle vh) const { if (!has_children(sh)) return null_simplex(); |