MCPcopy Create free account
hub / github.com/TruthHun/BookStack / fixedtables

Function fixedtables

static/word2md/mammoth.browser.js:20742–20773  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

20740var lenfix, distfix; // We have no pointers in JS, so keep tables separate
20741
20742function fixedtables(state) {
20743 /* build fixed huffman tables if first call (may not be thread safe) */
20744 if (virgin) {
20745 var sym;
20746
20747 lenfix = new utils.Buf32(512);
20748 distfix = new utils.Buf32(32);
20749
20750 /* literal/length table */
20751 sym = 0;
20752 while (sym < 144) { state.lens[sym++] = 8; }
20753 while (sym < 256) { state.lens[sym++] = 9; }
20754 while (sym < 280) { state.lens[sym++] = 7; }
20755 while (sym < 288) { state.lens[sym++] = 8; }
20756
20757 inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
20758
20759 /* distance table */
20760 sym = 0;
20761 while (sym < 32) { state.lens[sym++] = 5; }
20762
20763 inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
20764
20765 /* do this just once */
20766 virgin = false;
20767 }
20768
20769 state.lencode = lenfix;
20770 state.lenbits = 9;
20771 state.distcode = distfix;
20772 state.distbits = 5;
20773}
20774
20775
20776/*

Callers 1

inflateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected