فهرست منبع

Using putIfAbsent instead of put

Seongguk Jeong 2 سال پیش
والد
کامیت
cd6f33c03e

+ 1 - 5
config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterOrderRegistration.java

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