Skip to content

Commit 19c253b

Browse files
committed
[ConstraintSystem] Convert argumentMatchingChoices to a map vector to avoid duplicates
1 parent e95e43d commit 19c253b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/swift/Sema/ConstraintSystem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,7 @@ class ConstraintSystem {
23942394

23952395
/// For locators associated with call expressions, the trailing closure
23962396
/// matching rule and parameter bindings that were applied.
2397-
std::vector<std::pair<ConstraintLocator *, MatchCallArgumentResult>>
2397+
llvm::MapVector<ConstraintLocator *, MatchCallArgumentResult>
23982398
argumentMatchingChoices;
23992399

24002400
/// The set of implicit value conversions performed by the solver on

lib/Sema/CSSimplify.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11566,7 +11566,7 @@ void ConstraintSystem::recordAnyTypeVarAsPotentialHole(Type type) {
1156611566
void ConstraintSystem::recordMatchCallArgumentResult(
1156711567
ConstraintLocator *locator, MatchCallArgumentResult result) {
1156811568
assert(locator->isLastElement<LocatorPathElt::ApplyArgument>());
11569-
argumentMatchingChoices.push_back({locator, result});
11569+
argumentMatchingChoices.insert({locator, result});
1157011570
}
1157111571

1157211572
ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(

lib/Sema/CSSolver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void ConstraintSystem::applySolution(const Solution &solution) {
245245

246246
// Remember all of the argument/parameter matching choices we made.
247247
for (auto &argumentMatch : solution.argumentMatchingChoices) {
248-
argumentMatchingChoices.push_back(argumentMatch);
248+
argumentMatchingChoices.insert(argumentMatch);
249249
}
250250

251251
// Register the solution's opened types.

0 commit comments

Comments
 (0)