Ignore:
Timestamp:
12/18/12 16:15:29 (11 years ago)
Author:
douglasz
Message:

Ticket #3236 - Correcoes para Performance: Function Within Loop Declaration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/library/PEAR/PEAR/Frontend/CLI.php

    r7655 r7673  
    579579    { 
    580580        $highest = 1; 
    581         for ($i = 0; $i < count($columns); ++$i) { 
     581        $columns_count = count($columns); 
     582        for ($i = 0; $i < $columns_count; ++$i) { 
    582583            $col = &$columns[$i]; 
    583584            if (isset($colparams[$i]) && !empty($colparams[$i]['wrap'])) { 
     
    672673        } 
    673674 
    674         for ($i = 0; $i < count($table_data); ++$i) { 
     675        $table_data_count = count($table_data); 
     676        for ($i = 0; $i < $table_data_count; ++$i) { 
    675677            extract($table_data[$i]); 
    676678            if (!is_array($rowparams)) { 
     
    684686            $rowlines = array(); 
    685687            if ($height > 1) { 
    686                 for ($c = 0; $c < count($data); $c++) { 
     688                $data_count = count($data); 
     689                for ($c = 0; $c < $data_count; $c++) { 
    687690                    $rowlines[$c] = preg_split('/(\r?\n|\r)/', $data[$c]); 
    688691                    if (count($rowlines[$c]) < $height) { 
     
    691694                } 
    692695            } else { 
    693                 for ($c = 0; $c < count($data); ++$c) { 
     696                $data_count = count($data); 
     697                for ($c = 0; $c < $data_count; ++$c) { 
    694698                    $rowlines[$c] = array($data[$c]); 
    695699                } 
     
    698702            for ($r = 0; $r < $height; ++$r) { 
    699703                $rowtext = ''; 
    700                 for ($c = 0; $c < count($data); ++$c) { 
     704                $data_count = count($data); 
     705                for ($c = 0; $c < $data_count; ++$c) { 
    701706                    if (isset($colparams[$c])) { 
    702707                        $attribs = array_merge($rowparams, $colparams); 
Note: See TracChangeset for help on using the changeset viewer.