Skip to content

Commit 1e29b32

Browse files
Optimize dict array validation to use true_count() (#8263)
## Summary Replace an inefficient `iter().all()` check with a direct `true_count()` comparison when validating that all values in a dictionary array are referenced. --------- Signed-off-by: Claude <noreply@anthropic.com>
1 parent d97d2bd commit 1e29b32

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub trait DictArrayExt: TypedArrayRef<Dict> + DictArraySlotsExt {
135135
}
136136

137137
let referenced_mask = self.compute_referenced_values_mask(true)?;
138-
let all_referenced = referenced_mask.iter().all(|v| v);
138+
let all_referenced = referenced_mask.true_count() == referenced_mask.len();
139139

140140
vortex_ensure!(all_referenced, "value in dict not referenced");
141141
}

0 commit comments

Comments
 (0)