From 14e77a54c9edc6f2ad8a4285e45bff5445ad848c Mon Sep 17 00:00:00 2001 From: Duilio Protti Date: Mon, 11 Jul 2016 16:18:52 -0300 Subject: [PATCH] Pre-increment is said to be faster in many situations --- src/compute.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compute.c b/src/compute.c index a58455e..e5fa447 100644 --- a/src/compute.c +++ b/src/compute.c @@ -253,8 +253,8 @@ inline byte *compute_surface(t_interpol *vector, gint32 width, gint32 height) guint32 color; byte *ptr_swap; - for (j = 0; j < height; j++) - for (i = 0; i < width; i++) { + for (j = 0; j < height; ++j) + for (i = 0; i < width; ++i) { interpol = &vector[add_dest]; add_src = (interpol->coord & 0xFFFF) * width + (interpol->coord >> 16); ptr_pix = &((byte *)surface1)[add_src]; @@ -266,7 +266,7 @@ inline byte *compute_surface(t_interpol *vector, gint32 width, gint32 height) surface2[add_dest] = (byte)255; else surface2[add_dest] = (byte)color; - add_dest++; + ++add_dest; } ptr_swap = surface2; surface2 = surface1; @@ -288,8 +288,8 @@ inline byte *compute_surface_mmx(t_interpol *vector, gint32 width, gint32 height register byte *ptr_pix; byte *ptr_swap; - for (j = 0; j < height; j++) - for (i = 0; i < width; i++) { + for (j = 0; j < height; ++j) + for (i = 0; i < width; ++i) { interpol = &vector[add_dest]; add_src = (interpol->coord & 0xFFFF) * width + (interpol->coord >> 16); ptr_pix = &((byte *)surface1)[add_src]; @@ -311,7 +311,7 @@ inline byte *compute_surface_mmx(t_interpol *vector, gint32 width, gint32 height surface2[add_dest] = 255; else surface2[add_dest] = (byte)color; - add_dest++; + ++add_dest; } ptr_swap = surface1; surface1 = surface2;