Skip to content

Commit 933dece

Browse files
committed
[Runtime] Minor simplification to swift_getWitnessTable().
1 parent 81909f2 commit 933dece

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3977,14 +3977,11 @@ swift::swift_getWitnessTable(const ProtocolConformanceDescriptor *conformance,
39773977
conformance->getProtocol());
39783978
};
39793979

3980-
// When there is no generic table, use the static witness table or
3980+
// When there is no generic table, or it doesn't require instantiation,
3981+
// use the pattern directly.
39813982
// accessor directly.
39823983
auto genericTable = conformance->getGenericWitnessTable();
3983-
if (!genericTable) {
3984-
return uniqueForeignWitnessTableRef(conformance->getWitnessTablePattern());
3985-
}
3986-
3987-
if (doesNotRequireInstantiation(conformance, genericTable)) {
3984+
if (!genericTable || doesNotRequireInstantiation(conformance, genericTable)) {
39883985
return uniqueForeignWitnessTableRef(conformance->getWitnessTablePattern());
39893986
}
39903987

0 commit comments

Comments
 (0)