Skip to content

Commit 0169d9d

Browse files
committed
refactor: remove explicit string conversion in PartitionType
Removed unnecessary explicit std::string() conversion when passing partition_field.name() to emplace_back. The SchemaField constructor accepts std::string, and the implicit conversion from string_view to std::string is cleaner and equally efficient. This simplifies the code without changing behavior or performance.
1 parent 7e784dc commit 0169d9d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/iceberg/partition_spec.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ Result<std::unique_ptr<StructType>> PartitionSpec::PartitionType(
8989

9090
// Create the partition field with the transform result type
9191
// Partition fields are always optional (can be null)
92-
partition_fields.emplace_back(partition_field.field_id(),
93-
std::string(partition_field.name()),
92+
partition_fields.emplace_back(partition_field.field_id(), partition_field.name(),
9493
std::move(result_type),
9594
/*optional=*/true);
9695
}

0 commit comments

Comments
 (0)