From: Antony Dovgal Date: Sun, 6 Aug 2006 13:27:38 +0000 (+0000) Subject: avoid extra strlen() call, we have the length of the data X-Git-Tag: RELEASE_1_0_0RC1~2075 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2103816e06db48b2ae949c72dcc1d250a40e080b;p=php avoid extra strlen() call, we have the length of the data --- diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 7e0c19f860..153825a548 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -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;