projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80e6e9c
)
Optimized javascript compressor.
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Mon, 31 Aug 2009 13:49:32 +0000
(13:49 +0000)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Mon, 31 Aug 2009 13:49:32 +0000
(13:49 +0000)
includes/main.inc
patch
|
blob
|
history
diff --git
a/includes/main.inc
b/includes/main.inc
index b1876099aff2346b8b4020a189cdb296697e190d..8c0fc8d3c9f42933f27cdcfb7d0fd9b692a35564 100644
(file)
--- a/
includes/main.inc
+++ b/
includes/main.inc
@@
-141,10
+141,11
@@
function js_compress($sJS)
$inNormalComment = false;
//loop through line's characters and take out any literal strings, replace them with ___i___ where i is the index of this string
- for($j=0;$j<strlen($line);$j++)
+ $len = strlen($line);
+ for($j=0;$j<$len;$j++)
{
- $c =
substr($line,$j,1);
- $d =
substr($line,$j,2)
;
+ $c =
$line[$j]; // this is _really_ faster than subst
+ $d =
$c.$line[$j+1]
;
//look for start of quote
if(!$inQuote && !$inComment)