save edges_count
authoralfadur
Wed, 07 Nov 2018 18:27:24 +0300
changeset 14176 8f82d87d223f
parent 14175 8354b390f1a2
child 14177 74ca70cb753d
save edges_count
rust/integral-geometry/src/lib.rs
--- a/rust/integral-geometry/src/lib.rs	Wed Nov 07 15:59:51 2018 +0100
+++ b/rust/integral-geometry/src/lib.rs	Wed Nov 07 18:27:24 2018 +0300
@@ -505,8 +505,9 @@
     }
 
     pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &mut Point> + 'a {
+        let edges_count = self.edges_count();
         let start = self.vertices.as_mut_ptr();
-        let end = unsafe { start.add(self.vertices.len()) };
+        let end = unsafe { start.add(edges_count) };
         PolygonPointsIteratorMut {
             source: self,
             start,