diff options
author | Daniel Jasper <djasper@google.com> | 2015-06-17 12:23:15 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-06-17 12:23:15 +0000 |
commit | 86666d6bf20c3c536e33b13e2b7e1eb77c68a5a9 (patch) | |
tree | 28f077612db253ce4879f823126d5d9400c26907 /lib/Format/BreakableToken.cpp | |
parent | 9b1cf833b8a0ca8f82737e936526989147f5fe94 (diff) |
clang-format: Don't generate unnecessary replacements for \r\n line endings.
Patch by Mathieu Champlon. Thank you.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/BreakableToken.cpp')
-rw-r--r-- | lib/Format/BreakableToken.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Format/BreakableToken.cpp b/lib/Format/BreakableToken.cpp index e3e162d070..e364986783 100644 --- a/lib/Format/BreakableToken.cpp +++ b/lib/Format/BreakableToken.cpp @@ -345,7 +345,7 @@ void BreakableBlockComment::adjustWhitespace(unsigned LineIndex, // Calculate the start of the non-whitespace text in the current line. size_t StartOfLine = Lines[LineIndex].find_first_not_of(Blanks); if (StartOfLine == StringRef::npos) - StartOfLine = Lines[LineIndex].size(); + StartOfLine = Lines[LineIndex].rtrim("\r\n").size(); StringRef Whitespace = Lines[LineIndex].substr(0, StartOfLine); // Adjust Lines to only contain relevant text. |