rename window -> s_window, close #60

master
Vitaly Puzrin 2015-09-13 14:23:40 +03:00
rodzic 3d02fb105c
commit 2bef4935c7
1 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -52,7 +52,8 @@ module.exports = function inflate_fast(strm, start) {
var wsize; /* window size or zero if not using window */
var whave; /* valid bytes in the window */
var wnext; /* window write index */
var window; /* allocated sliding window, if wsize != 0 */
// Use `s_window` instead `window`, avoid conflict with instrumentation tools
var s_window; /* allocated sliding window, if wsize != 0 */
var hold; /* local strm.hold */
var bits; /* local strm.bits */
var lcode; /* local strm.lencode */
@ -86,7 +87,7 @@ module.exports = function inflate_fast(strm, start) {
wsize = state.wsize;
whave = state.whave;
wnext = state.wnext;
window = state.window;
s_window = state.window;
hold = state.hold;
bits = state.bits;
lcode = state.lencode;
@ -204,13 +205,13 @@ module.exports = function inflate_fast(strm, start) {
//#endif
}
from = 0; // window index
from_source = window;
from_source = s_window;
if (wnext === 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = window[from++];
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
@ -222,14 +223,14 @@ module.exports = function inflate_fast(strm, start) {
if (op < len) { /* some from end of window */
len -= op;
do {
output[_out++] = window[from++];
output[_out++] = s_window[from++];
} while (--op);
from = 0;
if (wnext < len) { /* some from start of window */
op = wnext;
len -= op;
do {
output[_out++] = window[from++];
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
@ -241,7 +242,7 @@ module.exports = function inflate_fast(strm, start) {
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = window[from++];
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;