Author: schittir
Date: 2025-02-14T09:05:41-08:00
New Revision: 0a037c6c3017a7785e22ce0bc2d1d2a66168d1fc

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

LOG: Revert "[NFC] Avoid potential null dereference. (#126872)"

This reverts commit f8c7457c79eece1bd1b7f15e7679517c7c63ad89.

Added: 
    

Modified: 
    clang/lib/Format/UnwrappedLineFormatter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/UnwrappedLineFormatter.cpp 
b/clang/lib/Format/UnwrappedLineFormatter.cpp
index dd667a9944515..14e984529d640 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -1610,7 +1610,7 @@ static auto computeNewlines(const AnnotatedLine &Line,
     if (Line.startsWith(TT_NamespaceRBrace)) {
       if (Style.WrapNamespaceBodyWithEmptyLines == FormatStyle::WNBWELS_Never)
         Newlines = 1;
-      else if (PreviousLine && !PreviousLine->startsWith(TT_NamespaceRBrace))
+      else if (!PreviousLine->startsWith(TT_NamespaceRBrace))
         Newlines = std::max(Newlines, 2u);
     }
   }


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

Reply via email to