From 535e7b09c189dd3a7ef65bd36a02962f0c98bd5e Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 18 Feb 2022 11:12:33 +0000 Subject: [PATCH] [clangd] lookupSiblingsWithinContext - remove unnecessary nullptr check The DC pointer is always dereferenced after the loop --- clang-tools-extra/clangd/refactor/Rename.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp index b106664..46d8845 100644 --- a/clang-tools-extra/clangd/refactor/Rename.cpp +++ b/clang-tools-extra/clangd/refactor/Rename.cpp @@ -389,7 +389,7 @@ const NamedDecl *lookupSiblingsWithinContext(ASTContext &Ctx, DeclarationName LookupName(&II); DeclContextLookupResult LookupResult; const auto *DC = RenamedDecl.getDeclContext(); - while (DC && DC->isTransparentContext()) + while (DC->isTransparentContext()) DC = DC->getParent(); switch (DC->getDeclKind()) { // The enclosing DeclContext may not be the enclosing scope, it might have -- 2.7.4