Skip to content

Commit

Permalink
⚡ Improve performance of CaffeineLoadingCache.put() method
Browse files Browse the repository at this point in the history
  • Loading branch information
ujibang committed Aug 26, 2024
1 parent 07a2541 commit b6a40c2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public Optional<V> getLoading(K key) {

@Override
public void put(K key, V value) {
wrapped.synchronous().put(key, Optional.ofNullable(value));
wrapped.put(key, CompletableFuture.supplyAsync(() -> Optional.ofNullable(value)));
}

@Override
Expand Down

0 comments on commit b6a40c2

Please sign in to comment.