-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small code cleanup #10690
Small code cleanup #10690
Conversation
There is no apparent advantage in calling `getIfPresent(key)` before calling `get(key)` on a loading cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % question (I'll get back with details)
@@ -494,10 +494,6 @@ private static PinotColumnHandle resolveAggregateExpressionWithAlias(PinotColumn | |||
|
|||
private static <K, V> V getFromCache(LoadingCache<K, V> cache, K key) | |||
{ | |||
V value = cache.getIfPresent(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC there was some mention that getIfPresent
is more contention safe than get
? Or was it about computeIfAbsent
?
I'll check and get back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However this doesn't seem to be in a hot path so shouldn't matter. Readability first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.