Use count in ParamsRequestCondition#getValueMatchCount

See gh-32088
This commit is contained in:
ryan-dia
2024-01-23 12:47:04 +09:00
committed by Stéphane Nicoll
parent 6bd7f0231d
commit 2daa074561

View File

@@ -137,13 +137,9 @@ public final class ParamsRequestCondition extends AbstractRequestCondition<Param
}
private long getValueMatchCount(Set<ParamExpression> expressions) {
long count = 0;
for (ParamExpression e : expressions) {
if (e.getValue() != null && !e.isNegated()) {
count++;
}
}
return count;
return expressions.stream()
.filter(e -> e.getValue() != null && !e.isNegated())
.count();
}