-Misc clean up/refactor.
-Removed unnecessary Map.containsKey calls -Using java 8 methods where possible to avoid external checks. Source L2J HighFive branch: https://github.com/L2J/L2J_Server/commit/9d0fee85372c72ff6fd2474c05cff89948940f14
This commit is contained in:
@@ -39,12 +39,8 @@ public final class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
String key = String.valueOf(task.getKey());
|
||||
if (!_holder.containsKey(key))
|
||||
{
|
||||
_holder.put(key, new ConcurrentHashMap<PunishmentType, PunishmentTask>());
|
||||
}
|
||||
_holder.get(key).put(task.getType(), task);
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user