From 539b221189ad1bd611fd4e3d72bda98f8881f632 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 26 Nov 2010 05:23:37 +0500 Subject: util.stanza, util.xmppstream, core.xmlhandlers: Allow stanza.last_add to be nil, and set it nil by default. Saves a table allocation per-element. 20% faster stanza building. --- util/xmppstream.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/xmppstream.lua') diff --git a/util/xmppstream.lua b/util/xmppstream.lua index 0a6d554b..29095e41 100644 --- a/util/xmppstream.lua +++ b/util/xmppstream.lua @@ -117,7 +117,8 @@ function new_sax_handlers(session, stream_callbacks) chardata = {}; end -- Complete stanza - if #stanza.last_add == 0 then + local last_add = stanza.last_add; + if not last_add or #last_add == 0 then if tagname ~= stream_error_tag then cb_handlestanza(session, stanza); else -- cgit v1.2.3