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/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php

    r7655 r7673  
    6969                 
    7070                if( is_array($users) ) 
    71                 {        
    72                         for($i = 0; $i < count($users); ++$i) 
     71                { 
     72            $users_count = count($users); 
     73                        for($i = 0; $i < $users_count; ++$i) 
    7374                        { 
    7475                                if( is_array($hostsJabber) ) 
     
    203204 
    204205                        $_restrict = array(); 
    205                          
    206                         for( $i = 0 ; $i < count($orgs) ; ++$i ) 
    207                         { 
    208                                 for( $j = 0 ; $j < count($array_uids) ; ++$j ) 
     206 
     207            $orgs_count = count($orgs); 
     208                        for( $i = 0 ; $i < $orgs_count; ++$i ) 
     209                        { 
     210                $array_uids_count = count($array_uids); 
     211                                for( $j = 0 ; $j < $array_uids_count; ++$j ) 
    209212                                { 
    210213                                        if( trim($array_uids[$j]['ou']) === trim($orgs[$i]) ) 
     
    331334                                                $posAll = $this->strallpos($ou_User, "OU=" ); 
    332335                                                $orgs = array(); 
    333                                  
    334                                                 for( $i = 0 ; $i < count($posAll); ++$i ) 
     336 
     337                        $posAll_count = count($posAll); 
     338                                                for( $i = 0 ; $i < $posAll_count; ++$i ) 
    335339                                                { 
    336340                                                        $pos = strpos($ou_User, ","); 
     
    369373                                                        $posAll = $this->strallpos($ou_User, "OU=" ); 
    370374                                                        $orgs = array(); 
    371                                          
    372                                                         for( $i = 0 ; $i < count($posAll); ++$i ) 
     375 
     376                            $posAll_count = count($posAll); 
     377                                                        for( $i = 0 ; $i < $posAll_count; ++$i ) 
    373378                                                        { 
    374379                                                                $pos = strpos($ou_User, ","); 
Note: See TracChangeset for help on using the changeset viewer.