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

Commit

Permalink
Removed unsafe.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Aug 4, 2021
1 parent 70b1168 commit 5fbe923
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,6 @@ impl<T: NativeType> MutableBuffer<T> {
}
}

/// Allocates a new [MutableBuffer] with `len` and capacity to be at least `len` where
/// all bytes are not initialized
#[inline]
pub unsafe fn from_len(len: usize) -> Self {
let mut buffer = MutableBuffer::with_capacity(len);
buffer.set_len(len);
buffer
}

/// Ensures that this buffer has at least `self.len + additional` bytes. This re-allocates iff
/// `self.len + additional > capacity`.
/// # Example
Expand Down
2 changes: 1 addition & 1 deletion src/compute/sort/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ where
let limit = limit.min(length);

let indices = if let Some(validity) = validity {
let mut indices = unsafe { MutableBuffer::<I>::from_len(length) };
let mut indices = MutableBuffer::<I>::from_len_zeroed(length);
if options.nulls_first {
let mut nulls = 0;
let mut valids = 0;
Expand Down

0 comments on commit 5fbe923

Please sign in to comment.