Skip to content

Commit

Permalink
fix: use concurrent hashmap instead of synchroniztion for recordcache
Browse files Browse the repository at this point in the history
Signed-off-by: Lev Povolotsky <[email protected]>
  • Loading branch information
povolev15 committed Jan 23, 2024
1 parent fd3fb3d commit 1dd0267
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public V get(@NonNull K key) {
markRead(key, value);
}
final var value = readCache.get(key);
return (value == marker) ? null : value;
return (value == marker) ? null : value;
}

/**
Expand Down Expand Up @@ -126,9 +126,8 @@ public void reset() {
* @param value The value
*/
protected final void markRead(@NonNull K key, @Nullable V value) {
if (value == null) readCache.put(key, (V)marker);
else readCache.put(key, value);

if (value == null) readCache.put(key, (V) marker);
else readCache.put(key, value);
}

/**
Expand Down

0 comments on commit 1dd0267

Please sign in to comment.