From: Andrey Kutejko Date: Sun, 16 Jun 2013 14:24:39 +0000 (+0300) Subject: minor optimization X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=16cd5dca1c0c29cc279df1ce3c85887afbb27ce7;p=ipf-template.git minor optimization --- diff --git a/ipf/template/compiler.php b/ipf/template/compiler.php index 04ae8a6..0042f8c 100644 --- a/ipf/template/compiler.php +++ b/ipf/template/compiler.php @@ -251,7 +251,7 @@ class IPF_Template_Compiler switch ($name) { case 'if': $res = 'if ('.$this->_parseFinal($args, $this->_allowedInExpr).'): '; - array_push($this->_blockStack, 'if'); + $this->_blockStack[] = 'if'; break; case 'else': if (end($this->_blockStack) != 'if') { @@ -271,11 +271,11 @@ class IPF_Template_Compiler '$t->_vars[\'foreach_counter\'] = 1;' . '$t->_vars[\'foreach_first\'] = true;' . 'foreach ('.$this->_parseFinal($args, array(T_AS, T_DOUBLE_ARROW, T_STRING, T_OBJECT_OPERATOR), array(';','!')).'): '; - array_push($this->_blockStack, 'foreach'); + $this->_blockStack[] = 'foreach'; break; case 'while': $res = 'while('.$this->_parseFinal($args, $this->_allowedInExpr).'):'; - array_push($this->_blockStack, 'while'); + $this->_blockStack[] = 'while'; break; case '/foreach': if(end($this->_blockStack) != 'foreach'){ @@ -324,7 +324,7 @@ class IPF_Template_Compiler $res = 'echo(__('.$argfct.'));'; break; case 'blocktrans': - array_push($this->_blockStack, 'blocktrans'); + $this->_blockStack[] = 'blocktrans'; $res = ''; $this->_transStack = array(); if ($args) {