Skip to content

Commit 89d6d75

Browse files
committed
[gardening] Eliminate never read variable. Courtesy of clang-tidy.
1 parent 59c6a64 commit 89d6d75

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/AST/ASTScope.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -865,14 +865,11 @@ ASTScope *ASTScope::createIfNeeded(const ASTScope *parent, Decl *decl) {
865865
if (decl->isImplicit()) return nullptr;
866866

867867
// Accessors are always nested within their abstract storage declaration.
868-
bool isAccessor = false;
869868
if (auto func = dyn_cast<FuncDecl>(decl)) {
870-
if (func->isAccessor()) {
871-
isAccessor = true;
872-
if (!parentDirectDescendedFromAbstractStorageDecl(
873-
parent, func->getAccessorStorageDecl()))
874-
return nullptr;
875-
}
869+
if (func->isAccessor() &&
870+
!parentDirectDescendedFromAbstractStorageDecl(
871+
parent, func->getAccessorStorageDecl()))
872+
return nullptr;
876873
}
877874

878875
ASTContext &ctx = decl->getASTContext();

0 commit comments

Comments
 (0)