Author: Owen Pan
Date: 2023-10-22T13:46:32-07:00
New Revision: 3e86cc4b864f609720c12cc97ff70a20aabb956f
URL: 
https://github.com/llvm/llvm-project/commit/3e86cc4b864f609720c12cc97ff70a20aabb956f
DIFF: 
https://github.com/llvm/llvm-project/commit/3e86cc4b864f609720c12cc97ff70a20aabb956f.diff

LOG: [clang-format][NFC] Simplify the logic in a return statement

Added: 
    

Modified: 
    clang/lib/Format/TokenAnnotator.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/TokenAnnotator.cpp 
b/clang/lib/Format/TokenAnnotator.cpp
index 7f85f48de2ed2ed..a457ced9f886846 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -4197,8 +4197,7 @@ bool TokenAnnotator::spaceRequiredBetween(const 
AnnotatedLine &Line,
   if ((Left.is(tok::l_brace) && Left.isNot(BK_Block)) ||
       (Right.is(tok::r_brace) && Right.MatchingParen &&
        Right.MatchingParen->isNot(BK_Block))) {
-    return Style.Cpp11BracedListStyle ? Style.SpacesInParensOptions.Other
-                                      : true;
+    return !Style.Cpp11BracedListStyle || Style.SpacesInParensOptions.Other;
   }
   if (Left.is(TT_BlockComment)) {
     // No whitespace in x(/*foo=*/1), except for JavaScript.


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

Reply via email to