replaced various !contains -> put with putIfAbsent

This commit is contained in:
igoudt 2017-01-09 13:07:32 +01:00
parent ab624c22ef
commit 316137b5e2
5 changed files with 16 additions and 27 deletions

View file

@ -64,9 +64,7 @@ public class LookedAt extends HashMap<String, Cards> implements Serializable, Co
}
public Cards createLookedAt(String name) {
if (!this.containsKey(name)) {
this.put(name, new CardsImpl());
}
putIfAbsent(name, new CardsImpl());
return this.get(name);
}