]> granicus.if.org Git - php/commitdiff
avoid extra strlen() call
authorAntony Dovgal <tony2001@php.net>
Sun, 6 Aug 2006 13:27:46 +0000 (13:27 +0000)
committerAntony Dovgal <tony2001@php.net>
Sun, 6 Aug 2006 13:27:46 +0000 (13:27 +0000)
ext/simplexml/simplexml.c

index 832cd535446c3d461704a8ca498acd94bebde37a..22757412cad51d8c9e7470fc79ce7d1e3297271f 100644 (file)
@@ -1229,10 +1229,11 @@ SXE_METHOD(asXML)
                        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;