Replace Map operations with computeIfAbsent

This commit is contained in:
Alexander Udalov
2017-04-01 01:54:14 +03:00
parent 5ebee6ceca
commit a9f35ae898
11 changed files with 16 additions and 64 deletions
@@ -120,12 +120,7 @@ public class AsmTypes {
@NotNull
public static Type getType(@NotNull Class<?> javaClass) {
Type type = TYPES_MAP.get(javaClass);
if (type == null) {
type = Type.getType(javaClass);
TYPES_MAP.put(javaClass, type);
}
return type;
return TYPES_MAP.computeIfAbsent(javaClass, k -> Type.getType(javaClass));
}
private AsmTypes() {