Skip to content

Commit 7436fb3

Browse files
committed
Rename CSFix::affectsSolutionScore() to impact().
1 parent de7b840 commit 7436fb3

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

include/swift/Sema/CSFix.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,8 @@ class ConstraintFix {
442442
}
443443
}
444444

445-
/// Whether this kind of fix affects the solution score, and which score
446-
/// it affects.
447-
Optional<ScoreKind> affectsSolutionScore() const;
445+
/// Determine the impact of this fix on the solution score, if any.
446+
Optional<ScoreKind> impact() const;
448447

449448
/// The diagnostic behavior limit that will be applied to any emitted
450449
/// diagnostics.

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9129,7 +9129,7 @@ Optional<SolutionApplicationTarget> ConstraintSystem::applySolution(
91299129
for (const auto fix : solution.Fixes) {
91309130
if (fix->isFatal())
91319131
canApplySolution = false;
9132-
if (fix->affectsSolutionScore() == SK_Fix && !fix->isFatal())
9132+
if (fix->impact() == SK_Fix && !fix->isFatal())
91339133
++numResolvableFixes;
91349134
}
91359135

lib/Sema/CSFix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using namespace constraints;
3737

3838
ConstraintFix::~ConstraintFix() {}
3939

40-
Optional<ScoreKind> ConstraintFix::affectsSolutionScore() const {
40+
Optional<ScoreKind> ConstraintFix::impact() const {
4141
switch (fixBehavior) {
4242
case FixBehavior::AlwaysWarning:
4343
return None;

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12711,8 +12711,8 @@ bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {
1271112711
// Record the fix.
1271212712

1271312713
// If this should affect the solution score, do so.
12714-
if (auto scoreKind = fix->affectsSolutionScore())
12715-
increaseScore(*scoreKind, impact);
12714+
if (auto impactScoreKind = fix->impact())
12715+
increaseScore(*impactScoreKind, impact);
1271612716

1271712717
// If we've made the current solution worse than the best solution we've seen
1271812718
// already, stop now.
@@ -12735,7 +12735,7 @@ bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {
1273512735
// Fixes that don't affect the score shouldn't be considered because even
1273612736
// if such a fix is recorded at that anchor this should not
1273712737
// have any affect in the recording of any other fix.
12738-
if (!fix->affectsSolutionScore())
12738+
if (!fix->impact())
1273912739
continue;
1274012740

1274112741
anchors.insert(fix->getAnchor());

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4638,7 +4638,7 @@ bool ConstraintSystem::diagnoseAmbiguityWithFixes(
46384638
// source of ambiguity or failures.
46394639
// Ignore warnings in favor of actual error fixes,
46404640
// because they are not the source of ambiguity/failures.
4641-
if (!fix->affectsSolutionScore())
4641+
if (!fix->impact())
46424642
continue;
46434643

46444644
fixes.insert({&solution, fix});

0 commit comments

Comments
 (0)