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

Function bi_flush

static/word2md/mammoth.browser.js:22585–22596  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

22583 * Flush the bit buffer, keeping at most 7 bits in it.
22584 */
22585function bi_flush(s) {
22586 if (s.bi_valid === 16) {
22587 put_short(s, s.bi_buf);
22588 s.bi_buf = 0;
22589 s.bi_valid = 0;
22590
22591 } else if (s.bi_valid >= 8) {
22592 s.pending_buf[s.pending++] = s.bi_buf & 0xff;
22593 s.bi_buf >>= 8;
22594 s.bi_valid -= 8;
22595 }
22596}
22597
22598
22599/* ===========================================================================

Callers 1

_tr_alignFunction · 0.70

Calls 1

put_shortFunction · 0.70

Tested by

no test coverage detected