ctubbsii commented on a change in pull request #410: Fixed inefficient auths
check
URL: https://github.com/apache/accumulo/pull/410#discussion_r177895877
##########
File path:
server/base/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthorizor.java
##########
@@ -163,11 +163,19 @@ public void changeAuthorizations(String user,
Authorizations authorizations) thr
@Override
public boolean isValidAuthorizations(String user, List<ByteBuffer> auths)
throws AccumuloSecurityException {
- Collection<ByteBuffer> userauths =
getCachedUserAuthorizations(user).getAuthorizationsBB();
- for (ByteBuffer auth : auths)
- if (!userauths.contains(auth))
+ if (auths.size() == 0) {
Review comment:
You should call `.isEmpty()`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services