Skip to content
Snippets Groups Projects
Commit e71b260a authored by Michael Hamann's avatar Michael Hamann
Browse files

Simplify js_compress() for regular expressions FS#2593

This simplifies a while loop in the js_compress() code. The
functionality of the new code is completely identical to the old code
but it uses less comparisons and according to FS#2593 it is thus a lot
faster.
parent 9aa38483
No related branches found
No related tags found
No related merge requests found
......@@ -301,10 +301,8 @@ function js_compress($s){
// now move forward and find the end of it
$j = 1;
while($s{$i+$j} != '/'){
while( ($s{$i+$j} != '\\') && ($s{$i+$j} != '/')){
$j = $j + 1;
}
if($s{$i+$j} == '\\') $j = $j + 2;
else $j++;
}
$result .= substr($s,$i,$j+1);
$i = $i + $j + 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment