Bug #13216 Updated: Removal of redundant function call

From: Date: Sun, 09 Sep 2001 02:38:45 +0000
Subject: Bug #13216 Updated: Removal of redundant function call
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-65518@lists.php.net to get a copy of this message
ID: 13216 User updated by: Paul.Hampson@Pobox.Com Reported By: Paul.Hampson@Pobox.Com Status: Open Bug Type: Feature/Change Request Operating System: Debian GNU/Linux PHP Version: 4.0.6 New Comment: Grr web interface: http://www.bubblesworth.com/php4.cvs2.diff Previous Comments: ------------------------------------------------------------------------ [2001-09-08 22:38:10] Paul.Hampson@Pobox.Com Since the webform saw fit to mangle my patch, it's available at <a href="http://www.bubblesworth.com/php4.cvs1.diff">http://www.bubblesworth.com/php4.cvs1.diff</a> ------------------------------------------------------------------------ [2001-09-08 22:31:18] Paul.Hampson@Pobox.Com Since encoded_value is set depending only on whether z_value is NULL(0) or not, surely there's no need to check Z_STRVAL_PP(z_value) before using encoded_value, and it just adds stuff to the normal execution path. At this point, we know either z_value is null, or Z_STRLEN_PP(z_value) is not 0. --- ext/standard/head.c.cvs Sun Sep 9 12:13:27 2001 +++ ext/standard/head.c.new Sun Sep 9 12:32:00 2001 @@ -142,7 +142,7 @@ sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s", Z_STRVAL_PP(z_name), dt); efree(dt); } else { - sprintf(cookie, "Set-Cookie: %s=%s", Z_STRVAL_PP(z_name), (z_value && Z_STRVAL_PP(z_value)) ? encoded_value : ""); + sprintf(cookie, "Set-Cookie: %s=%s", Z_STRVAL_PP(z_name), z_value ? encoded_value : ""); if (expires > 0) { strcat(cookie, "; expires="); dt = php_std_date(expires); -- Paul "TBBle" Hampson ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13216&edit=1

« previous php.dev (#65518) next »