Skip to content

Commit

Permalink
atlas: simplify compare method for name
Browse files Browse the repository at this point in the history
Before the check for name against k1 could happen multiple
times.
  • Loading branch information
brharrington committed Jul 26, 2024
1 parent 62130d0 commit 707c77b
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ private static <V> QueryIndex<V> empty(CacheSupplier<V> cacheSupplier) {
* This allows the {@link Id} to be traversed in order while performing the lookup.
*/
private static int compare(String k1, String k2) {
if ("name".equals(k1) && "name".equals(k2)) {
return 0;
} else if ("name".equals(k1)) {
return -1;
if ("name".equals(k1)) {
return "name".equals(k2) ? 0 : -1;
} else if ("name".equals(k2)) {
return 1;
} else {
Expand Down

0 comments on commit 707c77b

Please sign in to comment.