Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
Replace Map.contains and Map.get with Map.get and null check
Browse files Browse the repository at this point in the history
  • Loading branch information
ewaldbenes committed Sep 11, 2018
1 parent 2f15ae5 commit 1a726f5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ private void addByLine(String line, HashMap<SettlerImageFlavor, Integer> priorit

SettlerImageFlavor flavor = new SettlerImageFlavor(type, action, material, direction);
int priority = flavor.calculatePriority();
if(!priorities.containsKey(flavor) || priorities.get(flavor) < priority) {
Integer cachedPriority = priorities.get(flavor);
if(cachedPriority == null || cachedPriority < priority) {
map.put(flavor, new SettlerImageMapItem(fileIndex, sequence, start, duration));
priorities.put(flavor, priority);
}
Expand Down

0 comments on commit 1a726f5

Please sign in to comment.