]> granicus.if.org Git - php/commitdiff
MFH: optimization via the row-major order.
authorTakeshi Abe <tabe@php.net>
Wed, 11 Feb 2009 16:31:27 +0000 (16:31 +0000)
committerTakeshi Abe <tabe@php.net>
Wed, 11 Feb 2009 16:31:27 +0000 (16:31 +0000)
ext/gd/libgd/gd.c

index 1694ec1d910828e525df1e04ff9f1a9e2afd8be9..ac54d120022939cd13626c05c2aafa665f686aae 100644 (file)
@@ -613,8 +613,8 @@ void gdImagePaletteCopy (gdImagePtr to, gdImagePtr from)
                xlate[i] = -1;
        }
 
-       for (x = 0; x < to->sx; x++) {
-               for (y = 0; y < to->sy; y++) {
+       for (y = 0; y < to->sy; y++) {
+               for (x = 0; x < to->sx; x++) {
                        p = gdImageGetPixel(to, x, y);
                        if (xlate[p] == -1) {
                                /* This ought to use HWB, but we don't have an alpha-aware version of that yet. */