Merge pull request #32088 from Ryan-Dia

* pr/32088:
  Upgrade copyright year of changed file
  Use count in ParamsRequestCondition#getValueMatchCount

Closes gh-32088
This commit is contained in:
Stéphane Nicoll 2024-01-23 09:04:28 +01:00
commit 484aee069e
1 changed files with 4 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -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();
}