Skip to content

Commit 84b212c

Browse files
committed
[ConstraintSytem] NFC: Remove unnecessary checking/counting from countDistinctOverloads
1 parent 878066b commit 84b212c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5302,12 +5302,10 @@ bool ConstraintSystem::diagnoseAmbiguityWithFixes(
53025302
/// provided set.
53035303
static unsigned countDistinctOverloads(ArrayRef<OverloadChoice> choices) {
53045304
llvm::SmallPtrSet<void *, 4> uniqueChoices;
5305-
unsigned result = 0;
53065305
for (auto choice : choices) {
5307-
if (uniqueChoices.insert(choice.getOpaqueChoiceSimple()).second)
5308-
++result;
5306+
uniqueChoices.insert(choice.getOpaqueChoiceSimple());
53095307
}
5310-
return result;
5308+
return uniqueChoices.size();
53115309
}
53125310

53135311
/// Determine the name of the overload in a set of overload choices.

0 commit comments

Comments
 (0)