diff options
author | Søren Sandmann Pedersen <ssp@l3000.localdomain> | 2010-12-05 08:16:28 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@l3000.localdomain> | 2010-12-20 10:48:50 -0500 |
commit | c38be0bf970e34a05300d9b72d64e03e3e266d69 (patch) | |
tree | ef759a2dc4ce9ad73e9a30c1a28994206f4d5cbb | |
parent | 755178b6326b7458268c3329c120473950cd4d08 (diff) |
Move xi outside loop
-rw-r--r-- | dda.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -59,11 +59,10 @@ dda (test_data_t *testdata) double dxdy = (x1 - x0) / (y1 - y0); double y = next_sample_y (y0); double x = (y - y0) * dxdy + x0; + double xi = next_sample_x (x); while (y < next_sample_y (y1)) { - double xi = next_sample_x (x); - if (testdata->points[i++] != xi || testdata->points[i++] != y) { @@ -72,7 +71,7 @@ dda (test_data_t *testdata) } x += sample_step_y (y) * dxdy; - + xi = next_sample_x (x); y += sample_step_y (y); } } |