Bug #68714 [Asn->Ana]: copy 'n paste error

From: Date: Sun, 12 Jul 2015 13:35:16 +0000
Subject: Bug #68714 [Asn->Ana]: copy 'n paste error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194350@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68714&edit=1 ID: 68714 Updated by: cmb@php.net Reported by: bugreports at internot dot info Summary: copy 'n paste error -Status: Assigned +Status: Analyzed Type: Bug Package: GD related Operating System: Linux Ubuntu 14.04 PHP Version: master-Git-2015-01-02 (Git) -Assigned To: pajoye +Assigned To: cmb Block user comment: N Private report: N New Comment: > I'm guessing the first one should be "if(old_y1!=my1)" ? Indeed, that would be cleaner. However, it doesn't change the behavior of the algorithm[1]. Actually, only one of old_y1 and old_y2 is needed, because old_y1!=my1 is equivalent to old_y2!=my2. This simplification is already done in the external libgd[2], however, one could go a step further and merge both for loops. [1] <https://github.com/php/php-src/blob/php-5.6.11/ext/gd/libgd/gd_arc.c#L81-L107> [2] <https://github.com/libgd/libgd/blob/gd-2.1.1/src/gd.c#L1897-L1923> Previous Comments: ------------------------------------------------------------------------ [2015-01-02 07:47:50] bugreports at internot dot info Description: ------------ Hi, In /ext/gd/libgd/gd_arc.c: 95 if(old_y2!=my2){ 96 for(i=mx1;i<=mx2;i++){ 97 gdImageSetPixel(im,i,my1,c); 98 } 99 } original: old_y2 != my2 looks like the original copy. 100 if(old_y2!=my2){ 101 for(i=mx1;i<=mx2;i++){ 102 gdImageSetPixel(im,i,my2,c); 103 } 104 } I'm guessing the first one should be "if(old_y1!=my1)" ? Thanks, ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68714&edit=1

« previous php.bugs (#194350) next »