From 8d2adb2126cbd752cdbc11f6c348d97c72ebfb1f Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Mon, 26 Sep 2022 11:17:04 +0800 Subject: [PATCH] test: Slightly simplify loop. --- test/scip_test_runner.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/scip_test_runner.cc b/test/scip_test_runner.cc index 0d2a6c6fb3..26cec11891 100644 --- a/test/scip_test_runner.cc +++ b/test/scip_test_runner.cc @@ -186,11 +186,10 @@ void formatSnapshot(const scip::Document &document, FormatOptions options, std:: out << ' '; // For '#' out << absl::StrReplaceAll(line, {{"\t", " "}}); out << '\n'; - while (occ_i < occurrences.size() && occurrences[occ_i].range()[0] == lineNumber - 1) { + for (; occ_i < occurrences.size() && occurrences[occ_i].range()[0] == lineNumber - 1; occ_i++) { auto occ = occurrences[occ_i]; auto range = SCIPRange(occ.range()); if (range.isMultiline()) { // FIXME(varun): Handle multiline occurrences. - occ_i++; continue; } bool isDefinition = ((unsigned(occ.symbol_roles()) & unsigned(scip::SymbolRole::Definition)) > 0); @@ -221,7 +220,6 @@ void formatSnapshot(const scip::Document &document, FormatOptions options, std:: }; printDocs(occ.override_documentation(), "override_documentation"); if (!(isDefinition && symbolTable.contains(occ.symbol()))) { - occ_i++; continue; } auto &symbolInfo = symbolTable[occ.symbol()]; @@ -248,7 +246,6 @@ void formatSnapshot(const scip::Document &document, FormatOptions options, std:: } out << '\n'; } - occ_i++; } } }