Avoid unnecessary sorting in AbstractHandlerMethodMapping
Closes gh-24704
This commit is contained in:
@@ -394,10 +394,11 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
||||
}
|
||||
|
||||
if (!matches.isEmpty()) {
|
||||
Comparator<Match> comparator = new MatchComparator(getMappingComparator(request));
|
||||
matches.sort(comparator);
|
||||
Match bestMatch = matches.get(0);
|
||||
if (matches.size() > 1) {
|
||||
Comparator<Match> comparator = new MatchComparator(getMappingComparator(request));
|
||||
matches.sort(comparator);
|
||||
bestMatch = matches.get(0);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace(matches.size() + " matching mappings: " + matches);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user