tony2001                Sun Aug  6 13:27:38 2006 UTC

  Modified files:              
    /php-src/ext/simplexml      simplexml.c 
  Log:
  avoid extra strlen() call, we have the length of the data
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.210&r2=1.211&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.210 
php-src/ext/simplexml/simplexml.c:1.211
--- php-src/ext/simplexml/simplexml.c:1.210     Mon Jun 26 15:36:45 2006
+++ php-src/ext/simplexml/simplexml.c   Sun Aug  6 13:27:38 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simplexml.c,v 1.210 2006/06/26 15:36:45 bjori Exp $ */
+/* $Id: simplexml.c,v 1.211 2006/08/06 13:27:38 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1230,10 +1230,11 @@
                        xmlNodeDumpOutput(outbuf, (xmlDocPtr) 
sxe->document->ptr, node, 0, 1, ((xmlDocPtr) sxe->document->ptr)->encoding);
                        xmlOutputBufferFlush(outbuf);
                        strval = xmlStrndup(outbuf->buffer->content, 
outbuf->buffer->use);
+                       strval_len = outbuf->buffer->use;
                        xmlOutputBufferClose(outbuf);
                }
 
-               RETVAL_STRINGL(strval, strlen(strval), 1);
+               RETVAL_STRINGL(strval, strval_len, 1);
                xmlFree(strval);
        } else {
                RETVAL_FALSE;
@@ -2264,7 +2265,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Simplexml support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.210 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.211 $");
        php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
                "enabled");

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

Reply via email to