[clang-format][NFC] Put all state change into the for statement

Differential Revision: https://reviews.llvm.org/D116563
This commit is contained in:
Björn Schäpers 2022-01-03 07:57:54 +01:00
parent 1da96f7449
commit 8f6af1d468
1 changed files with 2 additions and 3 deletions

View File

@ -1162,7 +1162,8 @@ unsigned UnwrappedLineFormatter::format(
bool FirstLine = true;
for (const AnnotatedLine *Line =
Joiner.getNextMergedLine(DryRun, IndentTracker);
Line; Line = NextLine, FirstLine = false) {
Line; PrevPrevLine = PreviousLine, PreviousLine = Line, Line = NextLine,
FirstLine = false) {
const AnnotatedLine &TheLine = *Line;
unsigned Indent = IndentTracker.getIndent();
@ -1252,8 +1253,6 @@ unsigned UnwrappedLineFormatter::format(
}
if (!DryRun)
markFinalized(TheLine.First);
PrevPrevLine = PreviousLine;
PreviousLine = &TheLine;
}
PenaltyCache[CacheKey] = Penalty;
return Penalty;