Using putIfAbsent instead of put

This commit is contained in:
Seongguk Jeong 2023-07-09 23:53:00 +09:00 committed by Josh Cummings
parent 9a50ca74b4
commit cd6f33c03e
1 changed files with 1 additions and 5 deletions

View File

@ -127,11 +127,7 @@ final class FilterOrderRegistration {
* @param position the position to associate with the {@link Filter} * @param position the position to associate with the {@link Filter}
*/ */
void put(Class<? extends Filter> filter, int position) { void put(Class<? extends Filter> filter, int position) {
String className = filter.getName(); this.filterToOrder.putIfAbsent(filter.getName(), position);
if (this.filterToOrder.containsKey(className)) {
return;
}
this.filterToOrder.put(className, position);
} }
/** /**