Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed Jun 13, 2024
1 parent c8c970c commit 9eefab6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@ public ValueWrapper putIfAbsent(Object key, Object value) {
}

private Key getKey(Object key) {
int userKey = key.hashCode();
// when no arguments are given return hash code of key's class (hash code of key itself can be equal to 1)
if (key instanceof SimpleKey && key.equals(SimpleKey.EMPTY)) userKey = key.getClass().hashCode();
int userKey = (key instanceof SimpleKey && key.equals(SimpleKey.EMPTY))
// return hash code of key's class (hash code of key itself can be equal to 1) when no arguments are given
? key.getClass().hashCode()
: key.hashCode();
return new Key(cacheConfiguration.getNamespace(), cacheConfiguration.getSet(), userKey);
}

Expand Down

0 comments on commit 9eefab6

Please sign in to comment.