Skip to content

Commit 3630640

Browse files
[clang-format] Remove double trim
Lines[i] is already trimmed 3 lines before Differential Revision: https://reviews.llvm.org/D91996
1 parent bb939eb commit 3630640

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clang/lib/Format/BreakableToken.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,10 +773,7 @@ BreakableLineCommentSection::BreakableLineCommentSection(
773773
OriginalPrefix.resize(Lines.size());
774774
for (size_t i = FirstLineIndex, e = Lines.size(); i < e; ++i) {
775775
Lines[i] = Lines[i].ltrim(Blanks);
776-
// We need to trim the blanks in case this is not the first line in a
777-
// multiline comment. Then the indent is included in Lines[i].
778-
StringRef IndentPrefix =
779-
getLineCommentIndentPrefix(Lines[i].ltrim(Blanks), Style);
776+
StringRef IndentPrefix = getLineCommentIndentPrefix(Lines[i], Style);
780777
assert((TokenText.startswith("//") || TokenText.startswith("#")) &&
781778
"unsupported line comment prefix, '//' and '#' are supported");
782779
OriginalPrefix[i] = Prefix[i] = IndentPrefix;

0 commit comments

Comments
 (0)