-Misc clean up/refactor.
-Removed unnecessary Map.containsKey calls
-Using java 8 methods where possible to avoid external checks.
Source L2J HighFive branch:
9d0fee8537
This commit is contained in:
@ -153,11 +153,7 @@ public class UIData implements IXmlReader
|
||||
*/
|
||||
public static void addCategory(Map<Integer, List<Integer>> map, int cat, int cmd)
|
||||
{
|
||||
if (!map.containsKey(cat))
|
||||
{
|
||||
map.put(cat, new ArrayList<Integer>());
|
||||
}
|
||||
map.get(cat).add(cmd);
|
||||
map.computeIfAbsent(cat, k -> new ArrayList<>()).add(cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,11 +164,7 @@ public class UIData implements IXmlReader
|
||||
*/
|
||||
public static void addKey(Map<Integer, List<ActionKey>> map, int cat, ActionKey akey)
|
||||
{
|
||||
if (!map.containsKey(cat))
|
||||
{
|
||||
map.put(cat, new ArrayList<ActionKey>());
|
||||
}
|
||||
map.get(cat).add(akey);
|
||||
map.computeIfAbsent(cat, k -> new ArrayList<>()).add(akey);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user