Skip to content

Commit 60bf252

Browse files
committed
cleanup
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
1 parent 33ecbeb commit 60bf252

File tree

2 files changed

+5
-34
lines changed

2 files changed

+5
-34
lines changed

vortex-array/src/arrays/patched/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ impl PatchedArray {
8686
values,
8787
} = transpose_patches(patches, ctx)?;
8888

89-
let len = inner.len();
90-
9189
let values = PrimitiveArray::from_buffer_handle(
9290
BufferHandle::new_host(values),
9391
values_ptype,
9492
Validity::NonNullable,
9593
)
9694
.into_array();
9795

96+
let len = inner.len();
97+
9898
Ok(Self {
9999
inner,
100100
n_chunks,

vortex-array/src/arrays/patched/mod.rs

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,18 @@ const fn patch_lanes<V: Sized>() -> usize {
3232
if size_of::<V>() < 8 { 32 } else { 16 }
3333
}
3434

35+
/// A cached accessor to the patch values.
3536
pub struct PatchAccessor<'a> {
3637
n_lanes: usize,
3738
lane_offsets: &'a [u32],
3839
indices: &'a [u16],
3940
}
4041

41-
pub struct PatchOffset {
42-
/// Global offset into the list of patches. These are some of the
43-
pub index: usize,
44-
/// This is the value stored in the `indices` buffer, which encodes the offset of the `index`-th
45-
/// patch
46-
pub chunk_offset: u16,
47-
}
48-
4942
impl<'a> PatchAccessor<'a> {
5043
/// Get an iterator over indices and values offsets.
5144
///
52-
/// The first component is the index into the `indices` and `values`, and the second component
53-
/// is the set of values instead here...I think?
45+
/// The first component is the index into the `indices` and `values`, and the second is
46+
/// the datum from `indices[index]` already prefetched.
5447
pub fn offsets_iter(
5548
&self,
5649
chunk: usize,
@@ -62,25 +55,3 @@ impl<'a> PatchAccessor<'a> {
6255
std::iter::zip(start..stop, self.indices[start..stop].iter().copied())
6356
}
6457
}
65-
66-
pub struct LanePatches<'a, V> {
67-
pub indices: &'a [u16],
68-
pub values: &'a [V],
69-
}
70-
71-
impl<'a, V: Copy> LanePatches<'a, V> {
72-
pub fn len(&self) -> usize {
73-
self.indices.len()
74-
}
75-
76-
pub fn is_empty(&self) -> bool {
77-
self.indices.is_empty()
78-
}
79-
80-
pub fn iter(&self) -> impl Iterator<Item = (u16, V)> {
81-
self.indices
82-
.iter()
83-
.copied()
84-
.zip(self.values.iter().copied())
85-
}
86-
}

0 commit comments

Comments
 (0)