Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

remove accidental quadratic null_count #991

Merged
merged 1 commit into from
May 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/array/primitive/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ impl<T: NativeType> MutablePrimitiveArray<T> {
let len = self.len();
if let Some(validity) = self.validity.as_mut() {
validity.extend_constant(len - validity.len(), true);
} else {
Copy link
Collaborator Author

@ritchie46 ritchie46 May 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no validity and we extend with true so we know that null_count == 0 no need to compute it.

let mut validity = MutableBitmap::new();
validity.extend_constant(len, true);
if validity.null_count() > 0 {
self.validity = Some(validity);
}
}
}

Expand Down