Skip to content

Commit 484aee0

Browse files
committed
Merge pull request #32088 from Ryan-Dia
* pr/32088: Upgrade copyright year of changed file Use count in ParamsRequestCondition#getValueMatchCount Closes gh-32088
2 parents 6bd7f02 + def7075 commit 484aee0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Diff for: spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/ParamsRequestCondition.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -137,13 +137,9 @@ public int compareTo(ParamsRequestCondition other, HttpServletRequest request) {
137137
}
138138

139139
private long getValueMatchCount(Set<ParamExpression> expressions) {
140-
long count = 0;
141-
for (ParamExpression e : expressions) {
142-
if (e.getValue() != null && !e.isNegated()) {
143-
count++;
144-
}
145-
}
146-
return count;
140+
return expressions.stream()
141+
.filter(e -> e.getValue() != null && !e.isNegated())
142+
.count();
147143
}
148144

149145

0 commit comments

Comments
 (0)