Skip to content

Commit

Permalink
Merge pull request #32088 from Ryan-Dia
Browse files Browse the repository at this point in the history
* pr/32088:
  Upgrade copyright year of changed file
  Use count in ParamsRequestCondition#getValueMatchCount

Closes gh-32088
  • Loading branch information
snicoll committed Jan 23, 2024
2 parents 6bd7f02 + def7075 commit 484aee0
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -137,13 +137,9 @@ public int compareTo(ParamsRequestCondition other, HttpServletRequest request) {
}

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();
}


Expand Down

0 comments on commit 484aee0

Please sign in to comment.