You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/10/09 06:03:03 UTC

[GitHub] [iceberg] linfey90 commented on a diff in pull request #5733: Api: Optimize the code

linfey90 commented on code in PR #5733:
URL: https://github.com/apache/iceberg/pull/5733#discussion_r990739016


##########
api/src/main/java/org/apache/iceberg/PartitionSpec.java:
##########
@@ -67,10 +67,7 @@ private PartitionSpec(
       Schema schema, int specId, List<PartitionField> fields, int lastAssignedFieldId) {
     this.schema = schema;
     this.specId = specId;
-    this.fields = new PartitionField[fields.size()];
-    for (int i = 0; i < this.fields.length; i += 1) {
-      this.fields[i] = fields.get(i);
-    }
+    this.fields = fields.toArray(new PartitionField[fields.size()]);

Review Comment:
   I got it, thanks very much!



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org