Skip to content

Commit fcb5217

Browse files
committed
AST: Change isResilient() to do the cheaper check first
1 parent 9af20c7 commit fcb5217

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ bool AbstractStorageDecl::isResilient(ModuleDecl *M,
18191819
case ResilienceExpansion::Minimal:
18201820
return isResilient();
18211821
case ResilienceExpansion::Maximal:
1822-
return isResilient() && M != getModuleContext();
1822+
return M != getModuleContext() && isResilient();
18231823
}
18241824
llvm_unreachable("bad resilience expansion");
18251825
}
@@ -2915,7 +2915,7 @@ bool NominalTypeDecl::isResilient(ModuleDecl *M,
29152915
case ResilienceExpansion::Minimal:
29162916
return isResilient();
29172917
case ResilienceExpansion::Maximal:
2918-
return isResilient() && M != getModuleContext();
2918+
return M != getModuleContext() && isResilient();
29192919
}
29202920
llvm_unreachable("bad resilience expansion");
29212921
}

0 commit comments

Comments
 (0)