This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 5fb3033eb Minor: Remove cloning ArrayData in with_precision_and_scale
(#3050)
5fb3033eb is described below
commit 5fb3033eb882784499667d0ba20792f71aebd980
Author: Liang-Chi Hsieh <[email protected]>
AuthorDate: Wed Nov 9 19:05:55 2022 -0800
Minor: Remove cloning ArrayData in with_precision_and_scale (#3050)
* Use reference in with_precision_and_scale
* Remove clone
---
arrow-array/src/array/primitive_array.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arrow-array/src/array/primitive_array.rs
b/arrow-array/src/array/primitive_array.rs
index b13ea5681..195e0009c 100644
--- a/arrow-array/src/array/primitive_array.rs
+++ b/arrow-array/src/array/primitive_array.rs
@@ -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