diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-11-26 05:23:37 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-11-26 05:23:37 +0500 |
commit | 539b221189ad1bd611fd4e3d72bda98f8881f632 (patch) | |
tree | a5e7725ac2f2792d43f0b7eaf49ee7a8704ac020 /core | |
parent | f55acdb2a9747045b39d3690f52a892d6440cc27 (diff) | |
download | prosody-539b221189ad1bd611fd4e3d72bda98f8881f632.tar.gz prosody-539b221189ad1bd611fd4e3d72bda98f8881f632.zip |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/xmlhandlers.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua index 182da894..c587548a 100644 --- a/core/xmlhandlers.lua +++ b/core/xmlhandlers.lua @@ -114,7 +114,8 @@ function init_xmlhandlers(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 |