Skip to content

Commit

Permalink
perf nitpick (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlg99 authored May 13, 2024
1 parent 1f02bf3 commit 0062dfd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,16 @@ private static String getJmsSelectorOnSubscription(Subscription subscription) {
}

private SelectorSupport parseSelector(String jmsSelector) {
// null returned by SelectorSupport.build in computeIfAbsent won't be cached
// and in such cases it is better to not avoid the calls/synchronization there.
if (jmsSelector == null || jmsSelector.isEmpty()) {
return null;
}
return selectors.computeIfAbsent(
jmsSelector,
s -> {
try {
return SelectorSupport.build(s, !s.isEmpty());
return SelectorSupport.build(s, true);
} catch (JMSException err) {
log.error("Cannot parse selector {}", s, err);
return null;
Expand Down

0 comments on commit 0062dfd

Please sign in to comment.