iliaa           Sun Jan 20 15:33:42 2008 UTC

  Modified files:              
    /php-src/ext/wddx   php_wddx_api.h wddx.c 
  Log:
  
  MFB: Optimize wddx boolean encoding
  
http://cvs.php.net/viewvc.cgi/php-src/ext/wddx/php_wddx_api.h?r1=1.29&r2=1.30&diff_format=u
Index: php-src/ext/wddx/php_wddx_api.h
diff -u php-src/ext/wddx/php_wddx_api.h:1.29 
php-src/ext/wddx/php_wddx_api.h:1.30
--- php-src/ext/wddx/php_wddx_api.h:1.29        Mon Dec 31 07:12:17 2007
+++ php-src/ext/wddx/php_wddx_api.h     Sun Jan 20 15:33:42 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_wddx_api.h,v 1.29 2007/12/31 07:12:17 sebastian Exp $ */
+/* $Id: php_wddx_api.h,v 1.30 2008/01/20 15:33:42 iliaa Exp $ */
 
 #ifndef PHP_WDDX_API_H
 #define PHP_WDDX_API_H
@@ -27,7 +27,8 @@
 #define WDDX_ARRAY_E                   "</array>"
 #define WDDX_BINARY_S                  "<binary>"
 #define WDDX_BINARY_E                  "</binary>"
-#define WDDX_BOOLEAN                   "<boolean value='%s'/>"
+#define WDDX_BOOLEAN_TRUE              "<boolean value='true'/>"
+#define WDDX_BOOLEAN_FALSE             "<boolean value='false'/>"
 #define WDDX_CHAR                              "<char code='%02X'/>"
 #define WDDX_COMMENT_S                 "<comment>"
 #define WDDX_COMMENT_E                 "</comment>"
http://cvs.php.net/viewvc.cgi/php-src/ext/wddx/wddx.c?r1=1.149&r2=1.150&diff_format=u
Index: php-src/ext/wddx/wddx.c
diff -u php-src/ext/wddx/wddx.c:1.149 php-src/ext/wddx/wddx.c:1.150
--- php-src/ext/wddx/wddx.c:1.149       Mon Dec 31 07:12:17 2007
+++ php-src/ext/wddx/wddx.c     Sun Jan 20 15:33:42 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: wddx.c,v 1.149 2007/12/31 07:12:17 sebastian Exp $ */
+/* $Id: wddx.c,v 1.150 2008/01/20 15:33:42 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -408,10 +408,7 @@
  */
 static void php_wddx_serialize_boolean(wddx_packet *packet, zval *var)
 {
-       char tmp_buf[WDDX_BUF_LEN];
-
-       snprintf(tmp_buf, sizeof(tmp_buf), WDDX_BOOLEAN, Z_LVAL_P(var) ? "true" 
: "false");
-       php_wddx_add_chunk(packet, tmp_buf);
+       php_wddx_add_chunk(packet, Z_LVAL_P(var) ? WDDX_BOOLEAN_TRUE : 
WDDX_BOOLEAN_FALSE);
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to