aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-11-26 05:23:37 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-11-26 05:23:37 +0500
commit539b221189ad1bd611fd4e3d72bda98f8881f632 (patch)
treea5e7725ac2f2792d43f0b7eaf49ee7a8704ac020 /core
parentf55acdb2a9747045b39d3690f52a892d6440cc27 (diff)
downloadprosody-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.lua3
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