keith-turner commented on code in PR #3276:
URL: https://github.com/apache/accumulo/pull/3276#discussion_r1157668745


##########
core/src/main/java/org/apache/accumulo/core/security/Authorizations.java:
##########
@@ -112,8 +124,13 @@ private void checkAuths() {
    */
   public Authorizations(Collection<byte[]> authorizations) {
     checkArgument(authorizations != null, "authorizations is null");
-    for (byte[] auth : authorizations)
+    Pair<Set<ByteSequence>,List<byte[]>> collections =
+        createInternalCollections(authorizations.size());
+    this.auths = collections.getFirst();
+    this.authsList = collections.getSecond();

Review Comment:
   We could avoid creating the Pair object by replacing 
`createInternalCollections` with two private static methods `createInternalSet` 
and `createInternalList`.
   
   ```suggestion
       this.auths = createInternalSet(authorizations.size());
       this.authsList = createInternalList(authorizations.size());
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to