Commit 21ca78bc authored by John Resig's avatar John Resig

A small fix that makes the Packer compressor about 10% more efficient.

parent 9dc40f56
...@@ -110,7 +110,7 @@ function pack(_script, _encoding, _fastDecode, _specialChars) { ...@@ -110,7 +110,7 @@ function pack(_script, _encoding, _fastDecode, _specialChars) {
var $parser = new ParseMaster; var $parser = new ParseMaster;
var $encode = _getEncoder(_encoding); var $encode = _getEncoder(_encoding);
// for high-ascii, don't encode single character low-ascii // for high-ascii, don't encode single character low-ascii
var $regexp = (_encoding > 62) ? /\w\w+/ : /\w+/; var $regexp = (_encoding > 62) ? /\w\w+/ : /(\(\)|\){|var |return |&&|==|typeof |function\(?|if\(|for\(|while\(|[a-zA-Z0-9]+|\)}|\[\d\])/;
// build the word list // build the word list
$keywords = _analyze($script, _globalize($regexp), $encode); $keywords = _analyze($script, _globalize($regexp), $encode);
var $encoded = $keywords.$encoded; var $encoded = $keywords.$encoded;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment