Author: Marek Kurdej
Date: 2022-03-18T15:01:40+01:00
New Revision: b6baab673a7c17747c245fa7b33d9b29ad9a107d

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

LOG: [clang-format] Refactor BreakableBlockComment constructor. NFC.

Added: 
    

Modified: 
    clang/lib/Format/BreakableToken.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/BreakableToken.cpp 
b/clang/lib/Format/BreakableToken.cpp
index ae084e9e14544..db7361bf5f2ff 100644
--- a/clang/lib/Format/BreakableToken.cpp
+++ b/clang/lib/Format/BreakableToken.cpp
@@ -410,11 +410,13 @@ BreakableBlockComment::BreakableBlockComment(
   }
   for (size_t i = 1, e = Content.size(); i < e && !Decoration.empty(); ++i) {
     const StringRef &Text = Content[i];
-    // If the last line is empty, the closing "*/" will have a star.
-    if (i + 1 == e && Text.empty())
-      break;
-    if (!Text.empty() && i + 1 != e && Decoration.startswith(Text))
+    if (i + 1 == e) {
+      // If the last line is empty, the closing "*/" will have a star.
+      if (Text.empty())
+        break;
+    } else if (!Text.empty() && Decoration.startswith(Text)) {
       continue;
+    }
     while (!Text.startswith(Decoration))
       Decoration = Decoration.drop_back(1);
   }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to