From: Simon Pilgrim Date: Fri, 18 Feb 2022 11:12:33 +0000 (+0000) Subject: [clangd] lookupSiblingsWithinContext - remove unnecessary nullptr check X-Git-Tag: upstream/15.0.7~15942 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=535e7b09c189dd3a7ef65bd36a02962f0c98bd5e;p=platform%2Fupstream%2Fllvm.git [clangd] lookupSiblingsWithinContext - remove unnecessary nullptr check The DC pointer is always dereferenced after the loop --- 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