diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2020-11-25 09:45:10 +0100 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2020-11-25 09:45:10 +0100 |
commit | 58444a462f658fa5c492f0f8ec816bf3b4f0a47e (patch) | |
tree | ecf9d4a979cdf8299104fe462ed2bb163737c823 | |
parent | cad58d092409b6763b386a3916b59f2db28452c2 (diff) |
fix unnecessary breaks in apparent pairs computation
-rw-r--r-- | ripser.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -505,11 +505,9 @@ public: auto cofacet = cofacets.next(); if (get_diameter(cofacet) == get_diameter(simplex)) { - if (get_index(cofacet) == get_index(simplex)) return facet; - break; + return (get_index(cofacet) == get_index(simplex)) ? facet : std::make_pair(0,-1); } } - break; } } return std::make_pair(0,-1); @@ -528,11 +526,9 @@ public: auto facet = facets.next(); if (get_diameter(facet) == get_diameter(simplex)) { - if (get_index(facet) == get_index(simplex)) return cofacet; - break; + return (get_index(facet) == get_index(simplex)) ? cofacet : std::make_pair(0,-1); } } - break; } } return std::make_pair(0,-1); |