Skip to content

Commit 5ebf452

Browse files
committed
Try zip over zip_eq
Signed-off-by: Adam Gutglick <[email protected]>
1 parent 8a25fef commit 5ebf452

File tree

34 files changed

+52
-78
lines changed

34 files changed

+52
-78
lines changed

encodings/alp/src/alp/compress.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use itertools::Itertools;
54
use vortex_array::ArrayRef;
65
use vortex_array::IntoArray;
76
use vortex_array::arrays::PrimitiveArray;
@@ -88,7 +87,7 @@ where
8887
Mask::Values(is_valid) => {
8988
let (pos, vals): (BufferMut<u64>, BufferMut<T>) = exceptional_positions
9089
.into_iter()
91-
.zip_eq(exceptional_values)
90+
.zip(exceptional_values)
9291
.filter(|(index, _)| {
9392
let is_valid = is_valid.value(*index as usize);
9493
if !is_valid {

encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use fastlanes::BitPacking;
5-
use itertools::Itertools;
65
use num_traits::PrimInt;
76
use vortex_array::IntoArray;
87
use vortex_array::arrays::PrimitiveArray;
@@ -313,7 +312,7 @@ fn bit_width_histogram_typed<T: NativePType + PrimInt>(
313312
}
314313
AllOr::Some(buffer) => {
315314
// Some values are valid
316-
for (is_valid, v) in buffer.iter().zip_eq(array.as_slice::<T>()) {
315+
for (is_valid, v) in buffer.iter().zip(array.as_slice::<T>()) {
317316
if is_valid {
318317
bit_widths[bit_width(*v)] += 1;
319318
} else {

encodings/fastlanes/src/bitpacking/array/bitpack_decompress.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use fastlanes::BitPacking;
5-
use itertools::Itertools;
65
use vortex_array::ToCanonical;
76
use vortex_array::arrays::PrimitiveArray;
87
use vortex_array::builders::ArrayBuilder;
@@ -151,7 +150,7 @@ fn insert_values_and_validity_at_indices_to_uninit_range<
151150
vortex_panic!("BitPackedArray somehow had nullable patch values");
152151
};
153152

154-
for (index, &value) in indices.iter().zip_eq(values) {
153+
for (index, &value) in indices.iter().zip(values) {
155154
dst.set_value(index.as_() - indices_offset, f(value));
156155
}
157156
}

encodings/fastlanes/src/bitpacking/compute/is_constant.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
use std::ops::Range;
55

6-
use itertools::Itertools;
76
use lending_iterator::LendingIterator;
87
use vortex_array::ToCanonical;
98
use vortex_array::arrays::IS_CONST_LANE_WIDTH;
@@ -159,7 +158,7 @@ fn apply_patches_idx_typed<T: BitPacked, I: IntegerPType>(
159158
for (i, &v) in patch_indices
160159
.iter()
161160
.map(|i| i.as_() - indices_offset)
162-
.zip_eq(patch_values)
161+
.zip(patch_values)
163162
.skip_while(|(i, _)| i < &values_range.start)
164163
.take_while(|(i, _)| i < &values_range.end)
165164
{

encodings/runend/src/compress.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use itertools::Itertools;
54
use vortex_array::ArrayRef;
65
use vortex_array::IntoArray;
76
use vortex_array::ToCanonical;
@@ -203,7 +202,7 @@ pub fn runend_decode_typed_primitive<T: NativePType>(
203202
match values_validity {
204203
Mask::AllTrue(_) => {
205204
let mut decoded: BufferMut<T> = BufferMut::with_capacity(length);
206-
for (end, value) in run_ends.zip_eq(values) {
205+
for (end, value) in run_ends.zip(values) {
207206
assert!(end <= length, "Runend end must be less than overall length");
208207
// SAFETY:
209208
// We preallocate enough capacity because we know the total length
@@ -215,7 +214,7 @@ pub fn runend_decode_typed_primitive<T: NativePType>(
215214
Mask::Values(mask) => {
216215
let mut decoded = BufferMut::with_capacity(length);
217216
let mut decoded_validity = BitBufferMut::with_capacity(length);
218-
for (end, value) in run_ends.zip_eq(
217+
for (end, value) in run_ends.zip(
219218
values
220219
.iter()
221220
.zip(mask.bit_buffer().iter())
@@ -252,7 +251,7 @@ pub fn runend_decode_typed_bool(
252251
match values_validity {
253252
Mask::AllTrue(_) => {
254253
let mut decoded = BitBufferMut::with_capacity(length);
255-
for (end, value) in run_ends.zip_eq(values.iter()) {
254+
for (end, value) in run_ends.zip(values.iter()) {
256255
decoded.append_n(value, end - decoded.len());
257256
}
258257
BoolArray::from_bit_buffer(decoded.freeze(), values_nullability.into())
@@ -263,7 +262,7 @@ pub fn runend_decode_typed_bool(
263262
Mask::Values(mask) => {
264263
let mut decoded = BitBufferMut::with_capacity(length);
265264
let mut decoded_validity = BitBufferMut::with_capacity(length);
266-
for (end, value) in run_ends.zip_eq(
265+
for (end, value) in run_ends.zip(
267266
values
268267
.iter()
269268
.zip(mask.bit_buffer().iter())

encodings/sparse/src/canonical.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
use std::sync::Arc;
55

6-
use itertools::Itertools;
76
use num_traits::NumCast;
87
use vortex_array::Array;
98
use vortex_array::Canonical;
@@ -410,21 +409,19 @@ fn canonicalize_sparse_struct(
410409
};
411410

412411
StructArray::try_from_iter_with_validity(
413-
names.iter().zip_eq(
414-
columns_patch_values
415-
.iter()
416-
.cloned()
417-
.zip_eq(fill_values)
418-
.map(|(patch_values, fill_value)| unsafe {
412+
names
413+
.iter()
414+
.zip(columns_patch_values.iter().cloned().zip(fill_values).map(
415+
|(patch_values, fill_value)| unsafe {
419416
SparseArray::new_unchecked(
420417
unresolved_patches
421418
.clone()
422419
.map_values(|_| Ok(patch_values))
423420
.vortex_expect("Replacing patch values"),
424421
fill_value,
425422
)
426-
}),
427-
),
423+
},
424+
)),
428425
validity,
429426
)
430427
.map(Canonical::Struct)
@@ -500,7 +497,7 @@ fn canonicalize_varbin_inner<I: IntegerPType>(
500497
};
501498

502499
let mut views = buffer_mut![fill; len];
503-
for (patch_index, &patch) in indices.into_iter().zip_eq(values.views().iter()) {
500+
for (patch_index, &patch) in indices.into_iter().zip(values.views().iter()) {
504501
let patch_index_usize = <usize as NumCast>::from(patch_index)
505502
.vortex_expect("var bin view indices must fit in usize");
506503
views[patch_index_usize] = patch;

encodings/sparse/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ fn patch_validity<I: NativePType + AsPrimitive<usize>>(
438438
}
439439
Mask::Values(mask_values) => {
440440
let is_valid = mask_values.bit_buffer().iter();
441-
for (index, is_valid) in indices.zip_eq(is_valid) {
441+
for (index, is_valid) in indices.zip(is_valid) {
442442
is_valid_buffer.set_to(index, is_valid);
443443
}
444444
}

encodings/zstd/src/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ impl ZstdArray {
621621
);
622622

623623
let mut views = BufferMut::<BinaryView>::zeroed(slice_n_rows);
624-
for (view, index) in valid_views.into_iter().zip_eq(valid_indices) {
624+
for (view, index) in valid_views.into_iter().zip(valid_indices) {
625625
views[*index] = view
626626
}
627627

vortex-array/src/arrays/bool/patch.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use itertools::Itertools;
54
use vortex_dtype::match_each_unsigned_integer_ptype;
65

76
use crate::ToCanonical;
@@ -26,7 +25,7 @@ impl BoolArray {
2625
for (idx, value) in indices
2726
.as_slice::<I>()
2827
.iter()
29-
.zip_eq(values.bit_buffer().iter())
28+
.zip(values.bit_buffer().iter())
3029
{
3130
#[allow(clippy::cast_possible_truncation)]
3231
own_values.set_to(*idx as usize - offset, value);

vortex-array/src/arrays/chunked/compute/mask.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn mask_slices(
105105
array
106106
.chunks()
107107
.iter()
108-
.zip_eq(chunked_filters)
108+
.zip(chunked_filters)
109109
.map(|(chunk, chunk_filter)| -> VortexResult<ArrayRef> {
110110
match chunk_filter {
111111
ChunkFilter::All => {

0 commit comments

Comments
 (0)