mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-03 21:41:30 +01:00
make TimedCounter#decrement(K) easier to read
This commit is contained in:
parent
7d4bfcd99d
commit
fa65b1af5e
@ -45,8 +45,12 @@ public class TimedCounter<K> extends ExpiringMap<K, Integer> {
|
||||
ExpiringEntry<Integer> e = entries.get(key);
|
||||
|
||||
if (e != null) {
|
||||
if (e.getValue() <= 0) { remove(key); }
|
||||
else {entries.put(key, new ExpiringEntry<>(e.getValue() - 1, e.getExpiration())); }
|
||||
if (e.getValue() <= 0) {
|
||||
remove(key);
|
||||
}
|
||||
else {
|
||||
entries.put(key, new ExpiringEntry<>(e.getValue() - 1, e.getExpiration()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user