cvs: smarty /libs Smarty_Compiler.class.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1071172358@cvsserver>
messju		Thu Dec 11 14:52:38 2003 EDT

  Modified files:              
    /smarty/libs	Smarty_Compiler.class.php 
  Log:
  little optimization for "is odd" and "is even"
  
  
  
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.302 smarty/libs/Smarty_Compiler.class.php:1.303
--- smarty/libs/Smarty_Compiler.class.php:1.302	Thu Dec 11 14:39:02 2003
+++ smarty/libs/Smarty_Compiler.class.php	Thu Dec 11 14:52:38 2003
@@ -39,7 +39,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.302 2003/12/11 19:39:02 mohrt Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.303 2003/12/11 19:52:38 messju Exp $ */
 
 /**
  * Template compiling class
@@ -1387,7 +1387,7 @@
                     $expr_arg = $tokens[$expr_end++];
                     $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
                 } else
-                    $expr = "!($is_arg % 2)";
+                    $expr = "!(1 & $is_arg)";
                 break;
 
             case 'odd':
@@ -1396,7 +1396,7 @@
                     $expr_arg = $tokens[$expr_end++];
                     $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
                 } else
-                    $expr = "($is_arg % 2)";
+                    $expr = "(1 & $is_arg)";
                 break;
 
             case 'div':

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.