From b713b42e1b055f706677dd8c18e0fea6a25431fa Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 26 Jan 2010 03:39:24 +0500 Subject: xmlhandlers: A little optimization. --- core/xmlhandlers.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua index 3d6ace12..5d565845 100644 --- a/core/xmlhandlers.lua +++ b/core/xmlhandlers.lua @@ -112,10 +112,6 @@ function init_xmlhandlers(session, stream_callbacks) end end function xml_handlers:EndElement(tagname) - local curr_ns,name = tagname:match(ns_pattern); - if name == "" then - curr_ns, name = "", curr_ns; - end if stanza then if #chardata > 0 then -- We have some character data in the buffer @@ -139,6 +135,10 @@ function init_xmlhandlers(session, stream_callbacks) cb_streamclosed(session); end else + local curr_ns,name = tagname:match(ns_pattern); + if name == "" then + curr_ns, name = "", curr_ns; + end cb_error(session, "parse-error", "unexpected-element-close", name); end stanza, chardata = nil, {}; -- cgit v1.2.3