Permalink
Browse files

Change while loop with foreach for performance

  • Loading branch information...
1 parent a6b3cd9 commit b183958af4534f2ff80ca08a383ce7bd3f7fac14 @acidvertigo acidvertigo committed Jan 10, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 catalog/install/templates/pages/index.php
@@ -163,8 +163,7 @@
<table border="0" width="100%" cellspacing="0" cellpadding="2" style="background: #fffbdf; border: 1px solid #ffc20b; padding: 2px;">
<?php
- reset($warning_array);
- while (list($key, $value) = each($warning_array)) {
+ foreach ($warning_array as $key => $value) {
echo ' <tr>' . "\n" .
' <td valign="top"><strong>' . $key . '</strong></td>' . "\n" .
' <td valign="top">' . $value . '</td>' . "\n" .
@@ -184,7 +183,8 @@
<p>
<?php
- for ($i=0, $n=sizeof($configfile_array); $i<$n; $i++) {
+ $n=sizeof($configfile_array);
+ for ($i=0; $i<$n; $i++) {
echo $configfile_array[$i];
if (isset($configfile_array[$i+1])) {

0 comments on commit b183958

Please sign in to comment.