Skip to content

Commit 694eb72

Browse files
committed
updated with apache#8658 changes
1 parent ad3d716 commit 694eb72

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arrow-select/src/zip.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,9 @@ impl<T: ByteArrayType> BytesScalarImpl<T> {
462462
predicate.iter().map(|b| if b { value_length } else { 0 }),
463463
);
464464

465-
let bytes = MutableBuffer::new_repeated(number_of_true, value);
465+
let mut bytes = MutableBuffer::with_capacity(0);
466+
bytes.repeat_slice_n_times(value, number_of_true);
467+
466468
let bytes = Buffer::from(bytes);
467469

468470
// If a value is true we need the TRUTHY and the null buffer will have 1 (meaning not null)
@@ -483,7 +485,8 @@ impl<T: ByteArrayType> BytesScalarImpl<T> {
483485
predicate.len(),
484486
));
485487

486-
let bytes = MutableBuffer::new_repeated(predicate.len(), value);
488+
let mut bytes = MutableBuffer::with_capacity(0);
489+
bytes.repeat_slice_n_times(value, predicate.len());
487490
let bytes = Buffer::from(bytes);
488491

489492
(bytes, offsets)
@@ -585,7 +588,7 @@ impl<T: ByteArrayType> BytesScalarImpl<T> {
585588
if start > filled {
586589
let false_repeat_count = start - filled;
587590
// Push false value `repeat_count` times
588-
mutable.push_slice_repeated(false_repeat_count, falsy_val);
591+
mutable.repeat_slice_n_times(falsy_val, false_repeat_count);
589592

590593
for _ in 0..false_repeat_count {
591594
offset_buffer_builder.push_length(falsy_len)
@@ -594,7 +597,7 @@ impl<T: ByteArrayType> BytesScalarImpl<T> {
594597

595598
let true_repeat_count = end - start;
596599
// fill with truthy values
597-
mutable.push_slice_repeated(true_repeat_count, truthy_val);
600+
mutable.repeat_slice_n_times(truthy_val, true_repeat_count);
598601

599602
for _ in 0..true_repeat_count {
600603
offset_buffer_builder.push_length(truthy_len)
@@ -605,7 +608,7 @@ impl<T: ByteArrayType> BytesScalarImpl<T> {
605608
if filled < predicate.len() {
606609
let false_repeat_count = predicate.len() - filled;
607610
// Copy the first item from the 'falsy' array into the output buffer.
608-
mutable.push_slice_repeated(false_repeat_count, falsy_val);
611+
mutable.repeat_slice_n_times(falsy_val, false_repeat_count);
609612

610613
for _ in 0..false_repeat_count {
611614
offset_buffer_builder.push_length(falsy_len)

0 commit comments

Comments
 (0)