@@ -570,12 +570,10 @@ FindNamedDecls(ASTContext *ast, const DeclBaseName &name, VisitNodeResult &resul
570
570
if (decl->hasInterfaceType ()) {
571
571
result._decls .push_back (decl);
572
572
Type decl_type;
573
- if (decl->hasInterfaceType ()) {
574
- decl_type = decl->getInterfaceType ();
575
- MetatypeType *meta_type = decl_type->getAs <MetatypeType>();
576
- if (meta_type)
577
- decl_type = meta_type->getInstanceType ();
578
- }
573
+ decl_type = decl->getInterfaceType ();
574
+ MetatypeType *meta_type = decl_type->getAs <MetatypeType>();
575
+ if (meta_type)
576
+ decl_type = meta_type->getInstanceType ();
579
577
result._types .push_back (decl_type);
580
578
}
581
579
}
@@ -633,15 +631,11 @@ FindNamedDecls(ASTContext *ast, const DeclBaseName &name, VisitNodeResult &resul
633
631
for (auto decl : decls) {
634
632
if (decl->hasInterfaceType ()) {
635
633
result._decls .push_back (decl);
636
- if (decl->hasInterfaceType ()) {
637
- result._types .push_back (decl->getInterfaceType ());
638
- MetatypeType *meta_type =
639
- result._types .back ()->getAs <MetatypeType>();
640
- if (meta_type)
641
- result._types .back () = meta_type->getInstanceType ();
642
- } else {
643
- result._types .push_back (Type ());
644
- }
634
+ result._types .push_back (decl->getInterfaceType ());
635
+ MetatypeType *meta_type =
636
+ result._types .back ()->getAs <MetatypeType>();
637
+ if (meta_type)
638
+ result._types .back () = meta_type->getInstanceType ();
645
639
}
646
640
}
647
641
return result._types .size ();
0 commit comments