mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Moved entrySet() call outside of for loop
This commit is contained in:
1 parent
46febe5c0a
commit
3bc02a708e
1 file changed
+2
-1
@@ -13,7 +13,8 @@ public class CacheHashMap<K, V extends CacheHashMap.CachedObject<?>> extends Has
|
||||
public V get(Object key) {
|
||||
synchronized (this) {
|
||||
List<K> keysToRemove = new ArrayList<>();
|
||||
for (Map.Entry<K,V> entry : this.entrySet()) {
|
||||
Set<Map.Entry<K,V>> entrySet = this.entrySet();
|
||||
for (Map.Entry<K,V> entry : entrySet) {
|
||||
if (!Objects.equals(key,entry.getKey())) {
|
||||
long timeDiff = entry.getValue().timeSinceAccessed();
|
||||
if (timeDiff > this.maxCacheTime) {
|
||||
|
||||
Reference in new issue
Block a user