From 5fb3033eb882784499667d0ba20792f71aebd980 Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Wed, 9 Nov 2022 19:05:55 -0800 Subject: [PATCH] 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 b13ea5681e87..195e0009c0cc 100644 --- a/arrow-array/src/array/primitive_array.rs +++ b/arrow-array/src/array/primitive_array.rs @@ -866,7 +866,7 @@ impl PrimitiveArray { // 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