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/inc/class.contacts_im.inc.php

    r7655 r7673  
    9292 
    9393                if( is_array($users) ) 
    94                 {        
    95                         for($i = 0; $i < count($users); ++$i) 
     94                { 
     95            $users_count = count($users); 
     96                        for($i = 0; $i < $users_count; ++$i) 
    9697                        { 
    9798                                if( is_array($hostsJabber) ) 
     
    225226 
    226227                        $_restrict = array(); 
    227                          
    228                         for( $i = 0 ; $i < count($orgs) ; ++$i ) 
    229                         { 
    230                                 for( $j = 0 ; $j < count($array_uids) ; ++$j ) 
     228 
     229            $orgs_count = count($orgs); 
     230                        for( $i = 0 ; $i < $orgs_count; ++$i ) 
     231                        { 
     232                $array_uids_count = count($array_uids); 
     233                                for( $j = 0 ; $j < $array_uids_count; ++$j ) 
    231234                                { 
    232235                                        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.