Skip to content

Commit 345d392

Browse files
committed
nit: avoid clone in RunArray row decoding via buffer stealing
Signed-off-by: lyang24 <lanqingy93@gmail.com>
1 parent 7f656ff commit 345d392

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arrow-row/src/run.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ pub unsafe fn decode<R: RunEndIndexType>(
134134
run_ends.push(R::Native::usize_as(idx));
135135
}
136136
unique_row_indices.push(decoded_values.len());
137-
decoded_values.push(decoded_data.clone());
137+
let capacity = decoded_data.capacity();
138+
decoded_values.push(std::mem::replace(&mut decoded_data, Vec::with_capacity(capacity)));
138139
}
139140
}
140141
// Add the final run end

0 commit comments

Comments
 (0)