summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <mail@ulrich-bauer.org>2020-11-25 09:45:10 +0100
committerUlrich Bauer <mail@ulrich-bauer.org>2020-11-25 09:45:10 +0100
commit58444a462f658fa5c492f0f8ec816bf3b4f0a47e (patch)
treeecf9d4a979cdf8299104fe462ed2bb163737c823
parentcad58d092409b6763b386a3916b59f2db28452c2 (diff)
fix unnecessary breaks in apparent pairs computation
-rw-r--r--ripser.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/ripser.cpp b/ripser.cpp
index 2452bfc..62eb848 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -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);