From b39979a4719e5a4a7cab173b603fd3520b4de545 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sun, 21 Jan 2024 17:00:40 -0800 Subject: [PATCH] Fixed signed integer overflow. Closes #1 --- ConflictSet.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 67c465c..0db067a 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -521,13 +521,9 @@ struct Iterator { // Call Stepwise::step for each element of remaining until it returns true. // Applies a permutation to `remaining` as a side effect. -template -void runInterleaved(std::span remaining, int stepLimit = -1) { +template void runInterleaved(std::span remaining) { while (remaining.size() > 0) { for (int i = 0; i < int(remaining.size());) { - if (stepLimit-- == 0) { - return; - } bool done = remaining[i].step(); if (done) { if (i != int(remaining.size()) - 1) { @@ -542,16 +538,9 @@ void runInterleaved(std::span remaining, int stepLimit = -1) { } }; -template -void runSequential(std::span remaining, int stepLimit = -1) { +template void runSequential(std::span remaining) { for (auto &r : remaining) { - if (stepLimit-- == 0) { - return; - } while (!r.step()) { - if (stepLimit-- == 0) { - return; - } } } }