summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2022-02-12 10:49:54 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2022-02-12 10:49:54 +0000
commit003e0382647fa311e1bd48bc5298a3182d6f2552 (patch)
tree3ddd35f3bac8f4f4d7df7d1195a65e3391e46cc1
parent5bc13f9d9471adc81c8bf2b62775b6e2fd72f8e6 (diff)
[clang-tidy] getOutermostNamespace - remove redundant nullptr check
The pointer is always dereferenced
-rw-r--r--clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp2
1 files changed, 1 insertions, 1 deletions
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);
}