changeset 9498:6abd94fdd827 libavcodec

Use / and % operators instead of reimplementing them with a loop.
author reimar
date Fri, 17 Apr 2009 19:56:50 +0000
parents cb387dff812d
children 7075d0be5ec4
files xan.c
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/xan.c	Fri Apr 17 19:49:55 2009 +0000
+++ b/xan.c	Fri Apr 17 19:56:50 2009 +0000
@@ -351,16 +351,8 @@
 
         /* coordinate accounting */
         total_pixels -= size;
-        while (size) {
-            if (x + size >= width) {
-                y++;
-                size -= (width - x);
-                x = 0;
-            } else {
-                x += size;
-                size = 0;
-            }
-        }
+        y += (x + size) / width;
+        x  = (x + size) % width;
     }
 }