Skip to content

Commit 18e1219

Browse files
committed
naming
Signed-off-by: Alexander Droste <[email protected]>
1 parent 1ccf92b commit 18e1219

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

vortex-compute/src/expand/buffer.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<T: Copy> Expand for Buffer<T> {
2626
(&mut buf_mut).expand(mask);
2727
buf_mut.freeze()
2828
}
29-
// Otherwise, expand into a new buffer at the target size.
29+
// Otherwise, expand into a new buffer.
3030
Err(buffer) => expand_into_new_buffer(buffer.as_slice(), mask),
3131
}
3232
}
@@ -83,7 +83,7 @@ impl<T: Copy> Expand for &mut BufferMut<T> {
8383
}
8484

8585
let buf_slice = self.as_mut_slice();
86-
scatter_into_slice(buf_slice, buf_len, mask_values);
86+
expand_into_slice_inplace(buf_slice, buf_len, mask_values);
8787
}
8888
}
8989
}
@@ -97,7 +97,7 @@ impl<T: Copy> Expand for &mut BufferMut<T> {
9797
/// * `buf_slice` - The buffer slice to scatter into (already expanded to mask length)
9898
/// * `src_len` - The original length of the buffer before expansion
9999
/// * `mask_values` - The mask indicating where elements should be placed
100-
fn scatter_into_slice<T: Copy>(
100+
fn expand_into_slice_inplace<T: Copy>(
101101
buf_slice: &mut [T],
102102
src_len: usize,
103103
mask_values: &vortex_mask::MaskValues,
@@ -136,21 +136,20 @@ fn scatter_into_slice<T: Copy>(
136136
///
137137
/// # Arguments
138138
///
139-
/// * `dest` - The destination buffer slice (already expanded to mask length)
140139
/// * `src` - The source elements to scatter
141-
/// * `src_len` - The length of the source buffer
140+
/// * `dest` - The destination buffer slice (already expanded to mask length)
142141
/// * `mask_values` - The mask indicating where elements should be placed
143142
fn scatter_into_slice_from<T: Copy>(
144-
dest: &mut [T],
145143
src: &[T],
146-
src_len: usize,
144+
dest: &mut [T],
147145
mask_values: &vortex_mask::MaskValues,
148146
) {
149147
let mask_len = dest.len();
150148

151149
// Pick the first value as a default value. The source buffer is not empty.
152150
let pseudo_default_value = src[0];
153151

152+
let src_len = src.len();
154153
let mut element_idx = src_len;
155154

156155
// Iterate backwards through the mask to avoid any issues.
@@ -204,7 +203,7 @@ fn expand_into_new_buffer<T: Copy>(src: &[T], mask: &Mask) -> Buffer<T> {
204203
}
205204

206205
let buf_slice = buf_mut.as_mut_slice();
207-
scatter_into_slice_from(buf_slice, src, src_len, mask_values);
206+
scatter_into_slice_from(src, buf_slice, mask_values);
208207
buf_mut.freeze()
209208
}
210209
}

vortex-compute/src/expand/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub trait Expand {
1818
/// The result will have length equal to the mask. All values of `self` are
1919
/// then scattered to the true positions of the mask. False positions can have
2020
/// any value that `Output` allows for. No assumption can be made that false
21-
/// positions are set the default value of `Output`.
21+
/// positions are set to the default value of `Output`.
2222
///
2323
///
2424
/// # Panics

0 commit comments

Comments
 (0)