Skip to content

Commit f4ef3cc

Browse files
committed
final fixes
1 parent 64ed4d4 commit f4ef3cc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

docs/rust/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Use :func:`~vortex.encoding.compress` to compress the Vortex array and check the
4545

4646
>>> cvtx = vortex.compress(vtx)
4747
>>> cvtx.nbytes
48-
15732
48+
15755
4949
>>> cvtx.nbytes / vtx.nbytes
5050
0.11...
5151

encodings/alp/src/alp/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,21 @@ pub trait ALPFloat: private::Sealed + Float + Display + 'static {
163163
.map(|(index, _)| index as u64)
164164
.collect();
165165

166-
if let Some(fill_value) =
167-
Self::find_first_non_patched_encoded_value(&encoded, &patch_indices)
168-
{
169-
for index in patch_indices.iter() {
170-
let index = *index as usize;
171-
encoded[index] = fill_value;
166+
if !patch_indices.is_empty() {
167+
if let Some(fill_value) =
168+
Self::first_non_patched_encoded_value(&encoded, &patch_indices)
169+
{
170+
for index in patch_indices.iter() {
171+
let index = *index as usize;
172+
encoded[index] = fill_value;
173+
}
172174
}
173175
}
174176

175177
(encoded, patch_indices)
176178
}
177179

178-
fn find_first_non_patched_encoded_value(
180+
fn first_non_patched_encoded_value(
179181
encoded: &[Self::ALPInt],
180182
patch_indices: &[u64],
181183
) -> Option<Self::ALPInt> {

0 commit comments

Comments
 (0)