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/Mail/Mail/RFC822.php

    r7655 r7673  
    332332        $string = $parts[0]; 
    333333 
    334         for ($i = 0; $i < count($parts); ++$i) { 
     334        $parts_count = count($parts); 
     335        for ($i = 0; $i < $parts_count; ++$i) { 
    335336            if ($this->_hasUnclosedQuotes($string) 
    336337                || $this->_hasUnclosedBrackets($string, '<>') 
     
    426427    { 
    427428        $parts = explode($char, $string); 
    428         for ($i = 0; $i < count($parts); ++$i){ 
     429        $parts_count = count($parts); 
     430        for ($i = 0; $i < $parts_count; ++$i){ 
    429431            if (substr($parts[$i], -1) == '\\' || $this->_hasUnclosedQuotes($parts[$i])) 
    430432                $num--; 
     
    500502        //                         geezer 
    501503        // ... or any other format valid by RFC 822. 
    502         for ($i = 0; $i < count($addresses); ++$i) { 
     504        $addresses_count = count($addresses); 
     505        for ($i = 0; $i < $addresses_count; ++$i) { 
    503506            if (!$this->validateMailbox($addresses[$i])) { 
    504507                if (empty($this->error)) { 
Note: See TracChangeset for help on using the changeset viewer.