This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo-access.git
The following commit(s) were added to refs/heads/main by this push:
new 5235094 Trivial AuthorizationsImpl.equals improvement
5235094 is described below
commit 52350947b2729368e8cfc3e9101e3dda896970b6
Author: Christopher Tubbs <[email protected]>
AuthorDate: Fri Mar 13 16:05:40 2026 -0400
Trivial AuthorizationsImpl.equals improvement
Short-circuit check for sameness in equals with fewer return statements
Trivial follow-up to #111
---
.../java/org/apache/accumulo/access/impl/AuthorizationsImpl.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/accumulo/access/impl/AuthorizationsImpl.java
b/modules/core/src/main/java/org/apache/accumulo/access/impl/AuthorizationsImpl.java
index 348d54e..b8c5295 100644
---
a/modules/core/src/main/java/org/apache/accumulo/access/impl/AuthorizationsImpl.java
+++
b/modules/core/src/main/java/org/apache/accumulo/access/impl/AuthorizationsImpl.java
@@ -35,10 +35,8 @@ public class AuthorizationsImpl implements Authorizations {
@Override
public boolean equals(Object o) {
- if (o instanceof AuthorizationsImpl oa) {
- return authorizations.equals(oa.authorizations);
- }
- return false;
+ return this == o
+ || (o instanceof AuthorizationsImpl oa &&
authorizations.equals(oa.authorizations));
}
@Override