Skip to content

Commit 9a6e320

Browse files
fix: solve some inconsistencies between code and comments (#15394)
* Handle inconsistency * Handle inconsistency * Handle inconsistency * Handle inconsistency
1 parent 660aa40 commit 9a6e320

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/common/arrow/src/arrow/array/primitive/mutable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<T: NativeType> MutablePrimitiveArray<T> {
320320
/// Note that if it is the first time a null appears in this array,
321321
/// this initializes the validity bitmap (`O(N)`).
322322
/// # Panic
323-
/// Panics iff index is larger than `self.len()`.
323+
/// Panics iff index is larger than or equal to `self.len()`.
324324
pub fn set(&mut self, index: usize, value: Option<T>) {
325325
assert!(index < self.len());
326326
// Safety:

src/common/arrow/src/arrow/array/union/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl UnionArray {
8989
.try_for_each(|(index, (data_type, child))| {
9090
if data_type != child {
9191
Err(Error::oos(format!(
92-
"The children DataTypes of a UnionArray must equal the children data types.
92+
"The children DataTypes of a UnionArray must equal the children data types.
9393
However, the field {index} has data type {data_type:?} but the value has data type {child:?}"
9494
)))
9595
} else {
@@ -244,7 +244,7 @@ impl UnionArray {
244244
/// # Implementation
245245
/// This operation is `O(F)` where `F` is the number of fields.
246246
/// # Panic
247-
/// This function panics iff `offset + length >= self.len()`.
247+
/// This function panics iff `offset + length > self.len()`.
248248
#[inline]
249249
pub fn slice(&mut self, offset: usize, length: usize) {
250250
assert!(

src/common/arrow/src/arrow/buffer/immutable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<T> Buffer<T> {
162162

163163
/// Slices this buffer starting at `offset`.
164164
/// # Panics
165-
/// Panics iff `offset` is larger than `len`.
165+
/// Panics iff `offset + length` is larger than `len`.
166166
#[inline]
167167
pub fn slice(&mut self, offset: usize, length: usize) {
168168
assert!(

0 commit comments

Comments
 (0)