Diff

core/xmlhandlers.lua @ 2505:0849e349992d

xmlhandlers: A little optimization.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 26 Jan 2010 03:39:24 +0500
parent 2493:ec09d16a51e1
child 2506:d11a781baf13
line wrap: on
line diff
--- a/core/xmlhandlers.lua	Tue Jan 26 02:30:56 2010 +0500
+++ b/core/xmlhandlers.lua	Tue Jan 26 03:39:24 2010 +0500
@@ -112,10 +112,6 @@
 		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 @@
 					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, {};