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

index 7e0c19f8600d5528812a585fe11251c99ec323f0..153825a54856fafedf5338bd438221b37450e982 100644 (file)
@@ -1230,10 +1230,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;