function deflate_huff(s, flush) {
  let bflush; /* set if current block must be flushed */
  for (;;) {
    /* Make sure that we have a literal to write. */ if (s.lookahead === 0) {
      fill_window(s);
      if (s.lookahead === 0) {
        if (flush === STATUS.Z_NO_FLUSH) {
          return BS_NEED_MORE;
        }
        break; /* flush the current block */
      }
    }
    /* Output a literal byte */ s.match_length = 0;
    //Tracevv((stderr,"%c", s->window[s->strstart]));
    /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees
      ._tr_tally(s, 0, s.window[s.strstart]);
    s.lookahead--;
    s.strstart++;
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === STATUS.Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/ return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}
/* ===========================================================================
 * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
 * (It will be regenerated if this run of deflate switches away from Huffman.)
 */
For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
(It will be regenerated if this run of deflate switches away from Huffman.)
For Z_HUFFMAN_ONLY do not look for matches . Do not maintain a hash table . ( It will be regenerated if this run of deflate switches away from Huffman . )
function deflate_huff(s, flush) {
  let bflush; 
  for (;;) {
     if (s.lookahead === 0) {
      fill_window(s);
      if (s.lookahead === 0) {
        if (flush === STATUS.Z_NO_FLUSH) {
          return BS_NEED_MORE;
        }
        break; 
      }
    }
     s.match_length = 0;
     bflush = trees
      ._tr_tally(s, 0, s.window[s.strstart]);
    s.lookahead--;
    s.strstart++;
    if (bflush) {
       flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
    }
  }
  s.insert = 0;
  if (flush === STATUS.Z_FINISH) {
     flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
     return BS_FINISH_DONE;
  }
  if (s.last_lit) {
     flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
  }
  return BS_BLOCK_DONE;
}
function deflate_huff ( s , flush ) { let bflush ; for ( ; ; ) { if ( s . lookahead === 0 ) { fill_window ( s ) ; if ( s . lookahead === 0 ) { if ( flush === STATUS . Z_NO_FLUSH ) { return BS_NEED_MORE ; } break ; } } s . match_length = 0 ; bflush = trees . _tr_tally ( s , 0 , s . window [ s . strstart ] ) ; s . lookahead -- ; s . strstart ++ ; if ( bflush ) { flush_block_only ( s , false ) ; if ( s . strm . avail_out === 0 ) { return BS_NEED_MORE ; } } } s . insert = 0 ; if ( flush === STATUS . Z_FINISH ) { flush_block_only ( s , true ) ; if ( s . strm . avail_out === 0 ) { return BS_FINISH_STARTED ; } return BS_FINISH_DONE ; } if ( s . last_lit ) { flush_block_only ( s , false ) ; if ( s . strm . avail_out === 0 ) { return BS_NEED_MORE ; } } return BS_BLOCK_DONE ; }
For Z_HUFFMAN_ONLY, do not look for matches.
For Z_HUFFMAN_ONLY do not look for matches .
/* set if current block must be flushed */ /* Make sure that we have a literal to write. */ /* flush the current block */ /* Output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ /*** FLUSH_BLOCK(s, 0); ***/ /***/ /*** FLUSH_BLOCK(s, 1); ***/ /***/ /*** FLUSH_BLOCK(s, 0); ***/ /***/