refactoring

pull/5477/merge
Nikita Koksharov 1 year ago
parent b3882800fc
commit b6895f357f

@ -619,16 +619,14 @@ public class BaseTransactionalMap<K, V> extends BaseTransactionalObject {
protected Set<K> keySet(String pattern, int count) { protected Set<K> keySet(String pattern, int count) {
Set<K> keys = map.keySet(pattern, count); Set<K> keys = map.keySet(pattern, count);
return keys.stream() return keys.stream()
.map(k -> Collections.singletonMap(k, toKeyHash(k)))
.filter(k -> { .filter(k -> {
HashValue hash = k.values().iterator().next(); HashValue hash = toKeyHash(k);
if (state.get(hash) == null if (state.get(hash) == null
|| state.get(hash) != BaseTransactionalMap.MapEntry.NULL) { || state.get(hash) != BaseTransactionalMap.MapEntry.NULL) {
return true; return true;
} }
return false; return false;
}) })
.map(m -> m.keySet().iterator().next())
.collect(Collectors.toSet()); .collect(Collectors.toSet());
} }

Loading…
Cancel
Save