Ignore:
Timestamp:
12/14/12 14:30:35 (11 years ago)
Author:
douglasz
Message:

Ticket #3236 - Melhorias de performance no codigo do Expresso.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/report/xajax/xajaxCompress.php

    r5307 r7655  
    5858        $escaped = false; 
    5959        $quoteChar = ""; 
    60          
    61         for($i=0;$i<count($lines);$i++) 
     60    $lines_count = count($lines); 
     61 
     62        for($i=0;$i<$lines_count;++$i) 
    6263        { 
    6364                $line = $lines[$i]; 
     
    6566         
    6667                //loop through line's characters and take out any literal strings, replace them with ___i___ where i is the index of this string 
    67                 for($j=0;$j<strlen($line);$j++) 
     68                for($j=0;$j<strlen($line);++$j) 
    6869                { 
    6970                        $c = substr($line,$j,1); 
     
    8990                                        $quoteChar = $d; 
    9091                                        $literal = $d;   
    91                                         $j++;    
     92                                        ++$j; 
    9293                                } 
    9394                                else if($d=="//") //ignore string markers that are found inside comments 
     
    126127                                        array_push($literal_strings,$literal); 
    127128         
    128                                         $j++; 
     129                                        ++$j; 
    129130                                } 
    130131                                else if($c == "\\" && !$escaped) 
     
    143144         
    144145        //now process each line at a time 
    145         for($i=0;$i<count($lines);$i++) 
     146    $lines_count = count($lines); 
     147        for($i=0;$i<$lines_count;++$i) 
    146148        { 
    147149                $line = $lines[$i]; 
     
    175177         
    176178        //finally loop through and replace all the literal strings: 
    177         for($i=0;$i<count($literal_strings);$i++) 
     179    $literal_strings_count = count($literal_strings); 
     180        for($i=0;$i<$literal_strings_count;++$i) 
    178181                $sJS = str_replace("___".$i."___",$literal_strings[$i],$sJS); 
    179182         
Note: See TracChangeset for help on using the changeset viewer.