Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
wjones127 committed Sep 18, 2023
1 parent 64ffe58 commit fda23da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 11 additions & 2 deletions arrow-array/src/array/fixed_size_binary_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,20 @@ impl FixedSizeBinaryArray {
self.value_length
}

/// Returns the value buffer.
pub fn value_data(&self) -> &Buffer {
/// Returns the values of this array.
///
/// Unlike [`Self::value_data`] this returns the [`Buffer`]
/// allowing for zero-copy cloning.
#[inline]
pub fn values(&self) -> &Buffer {
&self.value_data
}

/// Returns the raw value data.
pub fn value_data(&self) -> &[u8] {
self.value_data.as_slice()
}

/// Returns a zero-copy slice of this array with the indicated offset and length.
pub fn slice(&self, offset: usize, len: usize) -> Self {
assert!(
Expand Down
3 changes: 1 addition & 2 deletions arrow-string/src/substring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ fn fixed_size_binary_substring(

// build value buffer
let num_of_elements = array.len();
let values = array.value_data();
let data = values.as_slice();
let data = array.value_data();
let mut new_values = MutableBuffer::new(num_of_elements * (new_len as usize));
(0..num_of_elements)
.map(|idx| {
Expand Down

0 comments on commit fda23da

Please sign in to comment.