Skip to content

Commit 956f1f6

Browse files
committed
Rm redundant call to ensure_unique
1 parent 08ad7a6 commit 956f1f6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/impl_methods.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
129129
pub fn iter_mut(&mut self) -> ElementsMut<A, D>
130130
where S: DataMut,
131131
{
132-
self.ensure_unique();
133132
self.view_mut().into_iter_()
134133
}
135134

@@ -229,8 +228,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
229228
where S: DataMut,
230229
I: NdIndex<Dim=D>,
231230
{
232-
self.ensure_unique();
233-
let ptr = self.ptr;
231+
let ptr = self.as_mut_ptr();
234232
index.index_checked(&self.dim, &self.strides)
235233
.map(move |offset| unsafe { &mut *ptr.offset(offset) })
236234
}

0 commit comments

Comments
 (0)