Skip to content

Commit 1407ce3

Browse files
test: Slightly simplify loop. (#123)
1 parent 0b6454b commit 1407ce3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

test/scip_test_runner.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,10 @@ void formatSnapshot(const scip::Document &document, FormatOptions options, std::
186186
out << ' '; // For '#'
187187
out << absl::StrReplaceAll(line, {{"\t", " "}});
188188
out << '\n';
189-
while (occ_i < occurrences.size() && occurrences[occ_i].range()[0] == lineNumber - 1) {
189+
for (; occ_i < occurrences.size() && occurrences[occ_i].range()[0] == lineNumber - 1; occ_i++) {
190190
auto occ = occurrences[occ_i];
191191
auto range = SCIPRange(occ.range());
192192
if (range.isMultiline()) { // FIXME(varun): Handle multiline occurrences.
193-
occ_i++;
194193
continue;
195194
}
196195
bool isDefinition = ((unsigned(occ.symbol_roles()) & unsigned(scip::SymbolRole::Definition)) > 0);
@@ -221,7 +220,6 @@ void formatSnapshot(const scip::Document &document, FormatOptions options, std::
221220
};
222221
printDocs(occ.override_documentation(), "override_documentation");
223222
if (!(isDefinition && symbolTable.contains(occ.symbol()))) {
224-
occ_i++;
225223
continue;
226224
}
227225
auto &symbolInfo = symbolTable[occ.symbol()];
@@ -248,7 +246,6 @@ void formatSnapshot(const scip::Document &document, FormatOptions options, std::
248246
}
249247
out << '\n';
250248
}
251-
occ_i++;
252249
}
253250
}
254251
}

0 commit comments

Comments
 (0)