Fix computeAsync for empty keys

Signed-off-by: Yordan Grancharov <phrone@gmail.com>
pull/6040/head
Yordan Grancharov 7 months ago
parent f00f03358e
commit 02d9fdc836

@ -259,12 +259,9 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
return CompletableFuture.supplyAsync(() -> remappingFunction.apply(key, oldValue), getServiceManager().getExecutor()) return CompletableFuture.supplyAsync(() -> remappingFunction.apply(key, oldValue), getServiceManager().getExecutor())
.thenCompose(newValue -> { .thenCompose(newValue -> {
if (newValue != null) { if (newValue != null) {
if (oldValue != null) {
return fastPutAsync(key, newValue) return fastPutAsync(key, newValue)
.thenApply(rr -> newValue); .thenApply(rr -> newValue);
} }
return CompletableFuture.completedFuture(newValue);
}
return fastRemoveAsync(key) return fastRemoveAsync(key)
.thenApply(rr -> newValue); .thenApply(rr -> newValue);
}); });

Loading…
Cancel
Save