mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Convert ImplicitValueConversions to a map vector to avoid duplicates
This commit is contained in:
@@ -2399,7 +2399,7 @@ private:
|
||||
|
||||
/// The set of implicit value conversions performed by the solver on
|
||||
/// a current path to reach a solution.
|
||||
SmallVector<std::pair<ConstraintLocator *, ConversionRestrictionKind>, 2>
|
||||
llvm::SmallMapVector<ConstraintLocator *, ConversionRestrictionKind, 2>
|
||||
ImplicitValueConversions;
|
||||
|
||||
/// The worklist of "active" constraints that should be revisited
|
||||
|
||||
@@ -11322,7 +11322,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
|
||||
FunctionType::get({FunctionType::Param(type1)}, type2),
|
||||
memberTy, applicationLoc);
|
||||
|
||||
ImplicitValueConversions.push_back(
|
||||
ImplicitValueConversions.insert(
|
||||
{getConstraintLocator(locator), restriction});
|
||||
return SolutionKind::Solved;
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ void ConstraintSystem::applySolution(const Solution &solution) {
|
||||
}
|
||||
|
||||
for (auto &valueConversion : solution.ImplicitValueConversions) {
|
||||
ImplicitValueConversions.push_back(valueConversion);
|
||||
ImplicitValueConversions.insert(valueConversion);
|
||||
}
|
||||
|
||||
// Register the argument lists.
|
||||
|
||||
Reference in New Issue
Block a user