tanmayrauth commented on code in PR #1376:
URL: https://github.com/apache/iceberg-go/pull/1376#discussion_r3523542633
##########
partitions.go:
##########
@@ -351,7 +351,14 @@ func NewPartitionSpec(fields ...PartitionField)
PartitionSpec {
//
// The fields are not verified against a schema, use NewPartitionSpecOpts if
you have to ensure compatibility.
func NewPartitionSpecID(id int, fields ...PartitionField) PartitionSpec {
- ret := PartitionSpec{id: id, fields: fields}
+ fieldCopies := make([]PartitionField, len(fields))
+ for i, field := range fields {
+ fieldCopies[i] = field
+ if field.SourceIDs != nil {
Review Comment:
this nil guard is redundant — `slices.Clone(nil)` already returns nil, so
you can drop the `if` and just always `fieldCopies[i].SourceIDs =
slices.Clone(field.SourceIDs)`. Behavior is identical, one less branch.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]