Skip to content

Commit c9b53c1

Browse files
committed
BUG: Fix so that stride_offset_checked is inlinable
Improves performance with checked indexing of higher dimensions (n >= 3)
1 parent 7dec4a2 commit c9b53c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/dimension/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ fn stride_offset_checked_arithmetic<D>(dim: &D, strides: &D, index: &D)
139139
}
140140

141141
/// Stride offset checked general version (slices)
142+
#[inline]
142143
pub fn stride_offset_checked(dim: &[Ix], strides: &[Ix], index: &[Ix]) -> Option<isize> {
143144
if index.len() != dim.len() {
144145
return None;

0 commit comments

Comments
 (0)