Skip to content

Commit d3bcdfd

Browse files
committed
[NamedLazyMemberLoading] Return empty vector rather than None on no-match.
1 parent 9e18594 commit d3bcdfd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Serialization/ModuleFile.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,13 +1798,12 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclName N,
17981798
PrettyStackTraceDecl trace("loading members for", IDC->getDecl());
17991799

18001800
assert(IDC->wasDeserialized());
1801+
assert(DeclMemberNames);
18011802

1802-
if (!DeclMemberNames)
1803-
return None;
1804-
1803+
TinyPtrVector<ValueDecl *> results;
18051804
auto i = DeclMemberNames->find(N.getBaseName());
18061805
if (i == DeclMemberNames->end())
1807-
return None;
1806+
return results;
18081807

18091808
BitOffset subTableOffset = *i;
18101809
std::unique_ptr<SerializedDeclMembersTable> &subTable =
@@ -1827,7 +1826,6 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclName N,
18271826
}
18281827

18291828
assert(subTable);
1830-
TinyPtrVector<ValueDecl *> results;
18311829
auto j = subTable->find(IDC->getDeclID());
18321830
if (j != subTable->end()) {
18331831
for (DeclID d : *j) {

0 commit comments

Comments
 (0)