From 003e0382647fa311e1bd48bc5298a3182d6f2552 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 12 Feb 2022 10:49:54 +0000 Subject: [PATCH] [clang-tidy] getOutermostNamespace - remove redundant nullptr check The pointer is always dereferenced --- clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp index 0636883c4819..91e9e026d0ad 100644 --- a/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp @@ -22,7 +22,7 @@ namespace llvm_libc { // Unit. const DeclContext *getOutermostNamespace(const DeclContext *Decl) { const DeclContext *Parent = Decl->getParent(); - if (Parent && Parent->isTranslationUnit()) + if (Parent->isTranslationUnit()) return Decl; return getOutermostNamespace(Parent); }