summaryrefslogtreecommitdiff
path: root/lib/exe/js.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-09-18 00:10:23 +0200
committerMichael Hamann <michael@content-space.de>2012-09-18 00:10:23 +0200
commite71b260a0446cb34eacbd16234691eca41feb9b1 (patch)
treeacf99b2a379dfa2a01c4ab01a2a38d60afb1af59 /lib/exe/js.php
parent9aa38483ceebb96c92d630550c000fc324738d0e (diff)
downloadrpg-e71b260a0446cb34eacbd16234691eca41feb9b1.tar.gz
rpg-e71b260a0446cb34eacbd16234691eca41feb9b1.tar.bz2
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.
Diffstat (limited to 'lib/exe/js.php')
-rw-r--r--lib/exe/js.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/exe/js.php b/lib/exe/js.php
index 634e21207..42979eeed 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -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;