[clang] a8aa256 - Revert "[NFC] Avoid potential null dereference." (#127228)

via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 09:33:44 PST 2025


Author: schittir
Date: 2025-02-14T09:33:41-08:00
New Revision: a8aa2566b97ff47bf52d963abc4dd5b16d3e5ba9

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

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

Reverts llvm/llvm-project#126872
The commit, though harmless, is unnecessary.

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);
     }
   }


        


More information about the cfe-commits mailing list