Skip to content

Commit c97ed7a

Browse files
committed
[Sema] Check cs.isForCodeCompletion() instead of checking for presence of CompletionCallback
This shouldn’t really change anything but is just a little cleaner.
1 parent c26b2f6 commit c97ed7a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Sema/CSRanking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
10081008
// problems with restating requirements in protocols.
10091009
identical = false;
10101010

1011-
if (cs.Context.CompletionCallback) {
1011+
if (cs.isForCodeCompletion()) {
10121012
// Don't rank based on overload choices of function calls that contain the
10131013
// code completion token.
10141014
ASTNode anchor = simplifyLocatorToAnchor(overload.locator);

lib/Sema/CSStep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ StepResult ConjunctionStep::resume(bool prevFailed) {
945945

946946
if (Solutions.size() == 1) {
947947
auto score = Solutions.front().getFixedScore();
948-
if (score.Data[SK_Fix] > 0 && !CS.getASTContext().CompletionCallback)
948+
if (score.Data[SK_Fix] > 0 && !CS.isForCodeCompletion())
949949
Producer.markExhausted();
950950
}
951951
} else if (Solutions.size() != 1) {

0 commit comments

Comments
 (0)