]> granicus.if.org Git - php/commitdiff
Remove useless else branch
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 6 Jan 2020 07:53:50 +0000 (08:53 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 6 Jan 2020 07:54:57 +0000 (08:54 +0100)
Passing `NULL` as `gdTransformAffineGetImage()`'s `src_area` is fine,
but in this case there's no need to calculate the `rect`, and since
`pRect` has already been initialized to `NULL`, we can remove the whole
else branch.

ext/gd/gd.c

index 8791940089c02c9fb19a26ea5f1820a3ce562a4f..68c5f4fe31db13dbda50e4ac2fce367b45b31fb5 100644 (file)
@@ -3936,12 +3936,6 @@ PHP_FUNCTION(imageaffine)
                        RETURN_THROWS();
                }
                pRect = &rect;
-       } else {
-               rect.x = -1;
-               rect.y = -1;
-               rect.width = gdImageSX(src);
-               rect.height = gdImageSY(src);
-               pRect = NULL;
        }
 
        if (gdTransformAffineGetImage(&dst, src, pRect, affine) != GD_TRUE) {