Comparison

core/xmlhandlers.lua @ 3638:6f58a3063c14

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.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 26 Nov 2010 05:23:37 +0500
parent 3540:bc139431830b
comparison
equal deleted inserted replaced
3637:bd491def3efb 3638:6f58a3063c14
112 -- We have some character data in the buffer 112 -- We have some character data in the buffer
113 stanza:text(t_concat(chardata)); 113 stanza:text(t_concat(chardata));
114 chardata = {}; 114 chardata = {};
115 end 115 end
116 -- Complete stanza 116 -- Complete stanza
117 if #stanza.last_add == 0 then 117 local last_add = stanza.last_add;
118 if not last_add or #last_add == 0 then
118 if tagname ~= stream_error_tag then 119 if tagname ~= stream_error_tag then
119 cb_handlestanza(session, stanza); 120 cb_handlestanza(session, stanza);
120 else 121 else
121 cb_error(session, "stream-error", stanza); 122 cb_error(session, "stream-error", stanza);
122 end 123 end