From 218aa04f793e9f572ad7e2216dbacbca7e1356db Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Sun, 6 Aug 2006 13:27:46 +0000 Subject: [PATCH] avoid extra strlen() call --- ext/simplexml/simplexml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 832cd53544..22757412ca 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -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; -- 2.50.1