From b48f46b0923d02d30f90f40d2c2c9940b578a588 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Wed, 11 Feb 2009 16:31:27 +0000 Subject: [PATCH] MFH: optimization via the row-major order. --- ext/gd/libgd/gd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 1694ec1d91..ac54d12002 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -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. */ -- 2.50.1