aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Format/BreakableToken.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-09-02 21:17:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-12-08 17:34:50 +0000
commit06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e (patch)
tree62f873df87c7c675557a179e0c4c83fe9f3087bc /contrib/llvm-project/clang/lib/Format/BreakableToken.cpp
parentcf037972ea8863e2bab7461d77345367d2c1e054 (diff)
parent7fa27ce4a07f19b07799a767fc29416f3b625afb (diff)
Diffstat (limited to 'contrib/llvm-project/clang/lib/Format/BreakableToken.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Format/BreakableToken.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/llvm-project/clang/lib/Format/BreakableToken.cpp b/contrib/llvm-project/clang/lib/Format/BreakableToken.cpp
index b3ef2a895d7f..af1e0748fafa 100644
--- a/contrib/llvm-project/clang/lib/Format/BreakableToken.cpp
+++ b/contrib/llvm-project/clang/lib/Format/BreakableToken.cpp
@@ -82,9 +82,9 @@ getCommentSplit(StringRef Text, unsigned ContentStartColumn,
NumChars < MaxSplit && MaxSplitBytes < Text.size();) {
unsigned BytesInChar =
encoding::getCodePointNumBytes(Text[MaxSplitBytes], Encoding);
- NumChars +=
- encoding::columnWidthWithTabs(Text.substr(MaxSplitBytes, BytesInChar),
- ContentStartColumn, TabWidth, Encoding);
+ NumChars += encoding::columnWidthWithTabs(
+ Text.substr(MaxSplitBytes, BytesInChar), ContentStartColumn + NumChars,
+ TabWidth, Encoding);
MaxSplitBytes += BytesInChar;
}
@@ -590,10 +590,8 @@ unsigned BreakableBlockComment::getContentIndent(unsigned LineIndex) const {
ContentWithNoDecoration = ContentWithNoDecoration.substr(1).ltrim(Blanks);
StringRef FirstWord = ContentWithNoDecoration.substr(
0, ContentWithNoDecoration.find_first_of(Blanks));
- if (ContentIndentingJavadocAnnotations.find(FirstWord) !=
- ContentIndentingJavadocAnnotations.end()) {
+ if (ContentIndentingJavadocAnnotations.contains(FirstWord))
return Style.ContinuationIndentWidth;
- }
return 0;
}