@@ -1982,9 +1982,7 @@ function LZ4_uncompress(input, output, sIdx, eIdx) {
1982
1982
* @return {Promise } with unzipped content
1983
1983
* @private */
1984
1984
async function R__unzip ( arr , tgtsize , noalert , src_shift ) {
1985
- const HDRSIZE = 9 , totallen = arr . byteLength ,
1986
- checkChar = ( o , symb ) => { return String . fromCharCode ( arr . getUint8 ( o ) ) === symb ; } ,
1987
- getCode = o => arr . getUint8 ( o )
1985
+ const HDRSIZE = 9 , totallen = arr . byteLength ;
1988
1986
1989
1987
let curr = src_shift || 0 , fullres = 0 , tgtbuf = null ;
1990
1988
@@ -1997,7 +1995,9 @@ async function R__unzip(arr, tgtsize, noalert, src_shift) {
1997
1995
return Promise . resolve ( null ) ;
1998
1996
}
1999
1997
2000
- const checkFmt = ( a , b , c ) => { return checkChar ( curr , a ) && checkChar ( curr + 1 , b ) && ( getCode ( curr + 2 ) === c ) ; } ;
1998
+ const getCode = o => arr . getUint8 ( o ) ,
1999
+ checkChar = ( o , symb ) => { return getCode ( o ) === symb . charCodeAt ( 0 ) ; } ,
2000
+ checkFmt = ( a , b , c ) => { return checkChar ( curr , a ) && checkChar ( curr + 1 , b ) && ( getCode ( curr + 2 ) === c ) ; } ;
2001
2001
2002
2002
if ( checkFmt ( 'Z' , 'L' , 8 ) ) {
2003
2003
fmt = 'new' ;
@@ -2008,7 +2008,7 @@ async function R__unzip(arr, tgtsize, noalert, src_shift) {
2008
2008
fmt = 'LZMA' ;
2009
2009
else if ( checkFmt ( 'Z' , 'S' , 1 ) )
2010
2010
fmt = 'ZSTD' ;
2011
- else if ( checkChar ( curr , 'L' ) && checkChar ( curr + 1 , '4' ) ) {
2011
+ else if ( checkChar ( curr , 'L' ) && checkChar ( curr + 1 , '4' ) ) {
2012
2012
fmt = 'LZ4' ; CHKSUM = 8 ;
2013
2013
}
2014
2014
0 commit comments