RE: [SMARTY] compiler suggestion
| From: | Steve | Date: | Fri, 31 May 2002 21:41:01 +0000 |
| Subject: | RE: [SMARTY] compiler suggestion | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4489@lists.php.net to get a copy of this message | ||
I mentioned this a while back and Monte said it was at the top of his todo
list. I made the changes then to my code. You are right, it is a very good
idea.
-----Original Message-----
From: David Norman [mailto:deekayen@deekayen.net]
Sent: Friday, May 31, 2002 11:10 AM
To: smarty-general@lists.php.net
Subject: [SMARTY] compiler suggestion
This is something small, but I have a suggestion for
some for loops in the Smarty compiler. Some examples
are on lines 113, 117, and 143 of 2.1.1.
>From line 162:
for ($i = 0; $i < count($strip_tags); $i++)
I think could have a slight performance benefit if
count() wasn't called every time. For your reading
pleasure, instead perhaps consider the following line:
for ($i = 0, $max = count($strip_tags); $i < $max;
$i++)
The loop at line 152 could especially benefit from
such a change since the output from APD
(apd.communityconnect.com) is showing me multiple
calls to count(). I only saw this case once (line
1152) in Smarty.class.php.
Just a thought as I was reading over the code.
David Norman - deekayen
http://atthat.com/
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php