Author: Simon Pilgrim Date: 2022-02-12T10:49:54Z New Revision: 003e0382647fa311e1bd48bc5298a3182d6f2552
URL: https://github.com/llvm/llvm-project/commit/003e0382647fa311e1bd48bc5298a3182d6f2552 DIFF: https://github.com/llvm/llvm-project/commit/003e0382647fa311e1bd48bc5298a3182d6f2552.diff LOG: [clang-tidy] getOutermostNamespace - remove redundant nullptr check The pointer is always dereferenced Added: Modified: clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp index 0636883c48193..91e9e026d0ad1 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); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits