change draw_thick_line iteration order to benchmark winner
authoralfadur
Fri, 19 Oct 2018 02:19:50 +0300
changeset 13970 a1895019bb94
parent 13969 c6e1769ac9aa
child 13971 48796bef9e69
change draw_thick_line iteration order to benchmark winner
rust/land2d/src/lib.rs
--- a/rust/land2d/src/lib.rs	Fri Oct 19 00:28:16 2018 +0200
+++ b/rust/land2d/src/lib.rs	Fri Oct 19 02:19:50 2018 +0300
@@ -225,9 +225,9 @@
     pub fn draw_thick_line(&mut self, from: Point, to: Point, radius: i32, value: T) -> usize {
         let mut result = 0;
 
-        for point in LinePoints::new(from, to) {
-            for vector in ArcPoints::new(radius) {
-                for delta in EquidistantPoints::new(vector) {
+        for vector in ArcPoints::new(radius) {
+            for delta in EquidistantPoints::new(vector) {
+                for point in LinePoints::new(from, to) {
                     self.map_point(point + delta, |p| {
                         if *p != value {
                             *p = value;