[clang] 574ad2a - [clang-format] Use prefix operator--. NFC.

Marek Kurdej via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 2 05:02:27 PST 2022


Author: Marek Kurdej
Date: 2022-02-02T14:01:48+01:00
New Revision: 574ad2a84626ffb0e7a64559e9862f20aadc013a

URL: https://github.com/llvm/llvm-project/commit/574ad2a84626ffb0e7a64559e9862f20aadc013a
DIFF: https://github.com/llvm/llvm-project/commit/574ad2a84626ffb0e7a64559e9862f20aadc013a.diff

LOG: [clang-format] Use prefix operator--. NFC.

Added: 
    

Modified: 
    clang/lib/Format/UnwrappedLineFormatter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp
index 01c151fec132..270b498fe471 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -330,7 +330,7 @@ class LineJoiner {
                nsToken->TokenText == getNamespaceTokenText(I[i + 1]) &&
                closingLine == I[i + 1]->MatchingClosingBlockLineIndex &&
                I[i + 1]->Last->TotalLength < Limit;
-             i++, closingLine--) {
+             i++, --closingLine) {
           // No extra indent for compacted namespaces
           IndentTracker.skipLine(*I[i + 1]);
 
@@ -346,7 +346,7 @@ class LineJoiner {
                nsToken->TokenText ==
                    getMatchingNamespaceTokenText(I[i + 1], AnnotatedLines) &&
                openingLine == I[i + 1]->MatchingOpeningBlockLineIndex;
-             i++, openingLine--) {
+             i++, --openingLine) {
           // No space between consecutive braces
           I[i + 1]->First->SpacesRequiredBefore = !I[i]->Last->is(tok::r_brace);
 


        


More information about the cfe-commits mailing list