diff --git a/src/base/storage.rs b/src/base/storage.rs index c09551c0..038884e3 100644 --- a/src/base/storage.rs +++ b/src/base/storage.rs @@ -72,7 +72,7 @@ pub unsafe trait Storage: Debug + Sized { /// Gets the address of the i-th matrix component without performing bound-checking. #[inline] unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N { - self.ptr().wrapping_offset(i as isize) + self.ptr().wrapping_add(i) } /// Gets the address of the i-th matrix component without performing bound-checking. @@ -124,7 +124,7 @@ pub unsafe trait StorageMut: Storage { /// Gets the mutable address of the i-th matrix component without performing bound-checking. #[inline] unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N { - self.ptr_mut().wrapping_offset(i as isize) + self.ptr_mut().wrapping_add(i) } /// Gets the mutable address of the i-th matrix component without performing bound-checking.