mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[GSB] Delete some redundant computation. NFC
This commit is contained in:
@@ -4572,14 +4572,6 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
|
||||
|
||||
// If we have a layout constraint, produce a layout requirement.
|
||||
if (equivClass->layout) {
|
||||
// Find the best source among the constraints that describe the layout
|
||||
// of this type.
|
||||
auto bestSource = equivClass->layoutConstraints.front().source;
|
||||
for (const auto &constraint : equivClass->layoutConstraints) {
|
||||
if (constraint.source->compare(bestSource) < 0)
|
||||
bestSource = constraint.source;
|
||||
}
|
||||
|
||||
f(RequirementKind::Layout, archetype, equivClass->layout,
|
||||
getBestConstraintSource<LayoutConstraint>(
|
||||
equivClass->layoutConstraints));
|
||||
@@ -4594,14 +4586,6 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
|
||||
assert(protocolSources.count(conforms.first) == 0 &&
|
||||
"redundant protocol requirement?");
|
||||
|
||||
// Find the best source among the constraints that describe conformance
|
||||
// to this protocol.
|
||||
auto bestSource = conforms.second.front().source;
|
||||
for (const auto &constraint : conforms.second) {
|
||||
if (constraint.source->compare(bestSource) < 0)
|
||||
bestSource = constraint.source;
|
||||
}
|
||||
|
||||
protocolSources.insert(
|
||||
{conforms.first,
|
||||
getBestConstraintSource<ProtocolDecl *>(conforms.second)});
|
||||
|
||||
Reference in New Issue
Block a user