Commit b964ee6f authored by Etienne CHAMPETIER's avatar Etienne CHAMPETIER

ZP-797 WBXMLDecoder->_getToken() speedup.

Released under the Affero GNU General Public License (AGPL) version 3.

When importing 1340 contacts on an android,
this is called 41437 times. With this small
optimisation, we save 0,44s (2,47 -> 2,03)
parent 9f950cb1
...@@ -360,10 +360,10 @@ class WBXMLDecoder extends WBXMLDefs { ...@@ -360,10 +360,10 @@ class WBXMLDecoder extends WBXMLDefs {
WBXMLDecoder::ResetInWhile("decoderGetToken"); WBXMLDecoder::ResetInWhile("decoderGetToken");
while(WBXMLDecoder::InWhile("decoderGetToken")) { while(WBXMLDecoder::InWhile("decoderGetToken")) {
$byte = $this->getByte(); $byte = fread($this->in, 1);
if($byte === "" || $byte === false)
if(!isset($byte))
break; break;
$byte = ord($byte);
switch($byte) { switch($byte) {
case WBXML_SWITCH_PAGE: case WBXML_SWITCH_PAGE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment