Skip to content

Commit

Permalink
Minor: Remove cloning ArrayData in with_precision_and_scale (apache#3050
Browse files Browse the repository at this point in the history
)

* Use reference in with_precision_and_scale

* Remove clone
  • Loading branch information
viirya authored Nov 10, 2022
1 parent c027c70 commit 5fb3033
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arrow-array/src/array/primitive_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ impl<T: DecimalType + ArrowPrimitiveType> PrimitiveArray<T> {

// safety: self.data is valid DataType::Decimal as checked above
let new_data_type = T::TYPE_CONSTRUCTOR(precision, scale);
let data = self.data().clone().into_builder().data_type(new_data_type);
let data = self.data.into_builder().data_type(new_data_type);

// SAFETY
// Validated data above
Expand Down

0 comments on commit 5fb3033

Please sign in to comment.