Skip to content

Commit 171fbaf

Browse files
committed
Remove redundant check
1 parent 011dc46 commit 171fbaf

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6161,17 +6161,14 @@ TinyPtrVector<ValueDecl *> ClangRecordMemberLookup::evaluate(
61616161
// Find the results that are actually a member of "recordDecl".
61626162
TinyPtrVector<ValueDecl *> result;
61636163
ClangModuleLoader *clangModuleLoader = ctx.getClangModuleLoader();
6164-
for (auto found : directResults) {
6165-
auto named = found.get<clang::NamedDecl *>();
6166-
if (dyn_cast<clang::Decl>(named->getDeclContext()) !=
6167-
recordDecl->getClangDecl())
6168-
continue;
6164+
for (auto foundEntry : directResults) {
6165+
auto found = foundEntry.get<clang::NamedDecl *>();
61696166

61706167
// Don't import constructors on foreign reference types.
6171-
if (isa<clang::CXXConstructorDecl>(named) && isa<ClassDecl>(recordDecl))
6168+
if (isa<clang::CXXConstructorDecl>(found) && isa<ClassDecl>(recordDecl))
61726169
continue;
61736170

6174-
auto imported = clangModuleLoader->importDeclDirectly(named);
6171+
auto imported = clangModuleLoader->importDeclDirectly(found);
61756172
if (!imported)
61766173
continue;
61776174

0 commit comments

Comments
 (0)