File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -1940,24 +1940,13 @@ static AbstractFunctionDecl *lookupObjCMethodInClass(
1940
1940
if (!methods.empty ()) {
1941
1941
// If we aren't inheriting initializers, remove any initializers from the
1942
1942
// list.
1943
- if (!inheritingInits &&
1944
- std::find_if (methods.begin (), methods.end (),
1945
- [](AbstractFunctionDecl *func) {
1946
- return isa<ConstructorDecl>(func);
1947
- }) != methods.end ()) {
1948
- SmallVector<AbstractFunctionDecl *, 4 > nonInitMethods;
1949
- std::copy_if (methods.begin (), methods.end (),
1950
- std::back_inserter (nonInitMethods),
1951
- [&](AbstractFunctionDecl *func) {
1952
- return !isa<ConstructorDecl>(func);
1953
- });
1954
- if (nonInitMethods.empty ())
1943
+ if (!inheritingInits) {
1944
+ llvm::erase_if (methods, [](AbstractFunctionDecl *afd) {
1945
+ return isa<ConstructorDecl>(afd);
1946
+ });
1947
+ if (methods.empty ())
1955
1948
return nullptr ;
1956
-
1957
- return *std::min_element (nonInitMethods.begin (), nonInitMethods.end (),
1958
- OrderDeclarations (srcMgr));
1959
1949
}
1960
-
1961
1950
return *std::min_element (methods.begin (), methods.end (),
1962
1951
OrderDeclarations (srcMgr));
1963
1952
}
You can’t perform that action at this time.
0 commit comments