From fde42a187d4a1a7abb4eaa3239cd884f8731b08a Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 1 Apr 2016 08:50:48 +0000 Subject: cpplint/cppcheck fixes git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@1091 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1c274cd8c8a3c76fe35f96c7186bcbf3d8bee3e8 --- src/Simplex_tree/include/gudhi/Simplex_tree.h | 14 +++++++------- src/common/include/gudhi/reader_utils.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index f5bc0a11..afc7d613 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -955,7 +955,7 @@ class Simplex_tree { bool operator()(const Simplex_handle sh1, const Simplex_handle sh2) const { // Not using st_->filtration(sh1) because it uselessly tests for null_simplex. if (sh1->second.filtration() != sh2->second.filtration()) { - return sh1->second.filtration() < sh2->second.filtration(); + return sh1->second.filtration() < sh2->second.filtration(); } // is sh1 a proper subface of sh2 return st_->reverse_lexicographic_order(sh1, sh2); @@ -1194,16 +1194,16 @@ class Simplex_tree { bool prune_above_filtration(Filtration_value filt) { return rec_prune_above_filtration(root(), filt); } - + private: bool rec_prune_above_filtration(Siblings* sib, Filtration_value filt) { - auto&& list=sib->members(); + auto&& list = sib->members(); auto last = std::remove_if(list.begin(), list.end(), [=](Dit_value_t& simplex) { - if (simplex.second.filtration()<=filt) return false; + if (simplex.second.filtration() <= filt) return false; if (has_children(&simplex)) rec_delete(simplex.second.children()); return true; }); - + bool modified = (last != list.end()); if (last == list.begin() && sib != root()) { // Removing the whole siblings, parent becomes a leaf. @@ -1213,8 +1213,8 @@ class Simplex_tree { } else { // Keeping some elements of siblings. Remove the others, and recurse in the remaining ones. list.erase(last, list.end()); - for(auto&& simplex : list) - if(has_children(&simplex)) + for (auto&& simplex : list) + if (has_children(&simplex)) modified |= rec_prune_above_filtration(simplex.second.children(), filt); } return modified; diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h index da2c2c36..899f9df6 100644 --- a/src/common/include/gudhi/reader_utils.h +++ b/src/common/include/gudhi/reader_utils.h @@ -161,7 +161,7 @@ bool read_simplex(std::istream & in_, std::vector< Vertex_handle > & simplex, Fi simplex.push_back(v); } in_ >> fil; - in_.ignore((std::numeric_limits::max)(), '\n'); // ignore until the carriage return + in_.ignore((std::numeric_limits::max)(), '\n'); // ignore until the carriage return return true; } -- cgit v1.2.3