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/mime/mimeDecode.php

    r7655 r7673  
    326326 
    327327                    $parts = $this->_boundarySplit($body, $content_type['other']['boundary']); 
    328                     for ($i = 0; $i < count($parts); ++$i) { 
     328                    $parts_count = count($parts); 
     329                    for ($i = 0; $i < $parts_count; ++$i) { 
    329330                        list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]); 
    330331                        $part = $this->_decode($part_header, $part_body, $default_ctype); 
     
    386387                $return[$prepend . $mime_number] = &$structure; 
    387388            } 
    388             for ($i = 0; $i < count($structure->parts); ++$i) { 
    389  
     389            $structure_parts_count = count($structure->parts); 
     390            for ($i = 0; $i < $structure_parts_count; ++$i) { 
    390391             
    391392                if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') { 
     
    792793        preg_match_all("/begin ([0-7]{3}) (.+)\r?\n(.+)\r?\nend/Us", $input, $matches); 
    793794 
    794         for ($j = 0; $j < count($matches[3]); ++$j) { 
     795        $matches_count = count($matches[3]); 
     796        for ($j = 0; $j < $matches_count; ++$j) { 
    795797 
    796798            $str      = $matches[3][$j]; 
     
    943945            // Multiple headers with this name 
    944946            if (is_array($headers[$hdr_name])) { 
    945                 for ($i = 0; $i < count($hdr_value); ++$i) { 
     947                $hdr_value_count = count($hdr_value); 
     948                for ($i = 0; $i < $hdr_value_count; ++$i) { 
    946949                    $output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value[$i], $indent); 
    947950                } 
     
    954957 
    955958        if (!empty($input->parts)) { 
    956             for ($i = 0; $i < count($input->parts); ++$i) { 
     959            $parts_count = count($input->parts); 
     960            for ($i = 0; $i < $parts_count; ++$i) { 
    957961                $output .= $crlf . str_repeat($htab, $indent) . '<mimepart>' . $crlf . 
    958962                           Mail_mimeDecode::_getXML($input->parts[$i], $indent+1) . 
Note: See TracChangeset for help on using the changeset viewer.