andrei          Thu Oct 19 20:24:25 2006 UTC

  Modified files:              
    /php-src/ext/json   json.c 
  Log:
  Clarify why the result of json_encode() is a binary string.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.18&r2=1.19&diff_format=u
Index: php-src/ext/json/json.c
diff -u php-src/ext/json/json.c:1.18 php-src/ext/json/json.c:1.19
--- php-src/ext/json/json.c:1.18        Thu Oct 19 10:12:19 2006
+++ php-src/ext/json/json.c     Thu Oct 19 20:24:25 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: json.c,v 1.18 2006/10/19 10:12:19 tony2001 Exp $ */
+/* $Id: json.c,v 1.19 2006/10/19 20:24:25 andrei Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -416,6 +416,10 @@
 
     json_encode_r(&buf, parameter TSRMLS_CC);
 
+       /*
+        * Return as binary string, since the result is 99% likely to be just
+        * echo'ed out and we want to avoid overhead of double conversion.
+        */
     ZVAL_STRINGL(return_value, buf.c, buf.len, 1);
 
     smart_str_free(&buf);

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

Reply via email to