Skip to content

Commit b3af2ef

Browse files
committed
[clang-format] Factor out loop variable. NFC.
* Break on the size of the used variable Content instead of Lines (even though both should have the same size).
1 parent 10243d0 commit b3af2ef

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clang/lib/Format/BreakableToken.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,14 @@ BreakableBlockComment::BreakableBlockComment(
410410
// now we just wrap them without stars.
411411
Decoration = "";
412412
}
413-
for (size_t i = 1, e = Lines.size(); i < e && !Decoration.empty(); ++i) {
413+
for (size_t i = 1, e = Content.size(); i < e && !Decoration.empty(); ++i) {
414+
const StringRef &Text = Content[i];
414415
// If the last line is empty, the closing "*/" will have a star.
415-
if (i + 1 == e && Content[i].empty())
416+
if (i + 1 == e && Text.empty())
416417
break;
417-
if (!Content[i].empty() && i + 1 != e && Decoration.startswith(Content[i]))
418+
if (!Text.empty() && i + 1 != e && Decoration.startswith(Text))
418419
continue;
419-
while (!Content[i].startswith(Decoration))
420+
while (!Text.startswith(Decoration))
420421
Decoration = Decoration.drop_back(1);
421422
}
422423

0 commit comments

Comments
 (0)