Skip to content

Commit 856483d

Browse files
author
Matthew Katz
committed
add comment
Signed-off-by: Matthew Katz <katz@spiraldb.com>
1 parent 17334a5 commit 856483d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • vortex-array/src/arrays/listview

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ impl Default for ListViewData {
315315
}
316316
}
317317

318-
/// Walks parallel `(offset, size)` slices and marks every referenced position in `buf`.
318+
/// Walks parallel `(offset, size)` slices and sets each range `[offset, offset + size]` in `buf`.
319319
///
320-
/// **Precondition**
320+
/// **Preconditions**
321321
///
322322
/// `offsets` and `sizes` must be the same length (which is always the case in valid `ListViewArray`s).
323323
fn fill_referenced_mask<O: IntegerPType, S: IntegerPType>(
@@ -460,7 +460,7 @@ pub trait ListViewArrayExt: TypedArrayRef<ListView> {
460460

461461
/// Exact fraction of `elements` referenced by some view, in `[0.0, 1.0]`. Extremely costly.
462462
///
463-
/// Returns `Ok(1.0)` when `elements` is empty.
463+
/// Returns `Ok(1.0)` when `elements` is empty instead of dividing by 0.
464464
fn compute_density(&self, ctx: &mut ExecutionCtx) -> VortexResult<f32> {
465465
if self.elements().is_empty() {
466466
return Ok(1.0);
@@ -484,7 +484,7 @@ pub trait ListViewArrayExt: TypedArrayRef<ListView> {
484484
///
485485
/// Exact for non-overlapping views, but overcounts when multiple views share the same elements.
486486
///
487-
/// Returns `Ok(1.0)` when `elements` is empty.
487+
/// Returns `Ok(1.0)` when `elements` is empty instead of dividing by 0.
488488
fn upper_bound_density(&self, ctx: &mut ExecutionCtx) -> VortexResult<f32> {
489489
let n_elts = self.elements().len();
490490
if n_elts == 0 {

0 commit comments

Comments
 (0)