compiler suggestion
| From: | David Norman | Date: | Fri, 31 May 2002 18:09:44 +0000 |
| Subject: | compiler suggestion | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-4488@lists.php.net to get a copy of this message | ||
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/