lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
# Flush the bit buffer, keeping at most 7 bits in it.
Flush the bit buffer, keeping at most 7 bits in it.
Flush the bit buffer keeping at most 7 bits in it .
def bi_flush(s)
    if (s.bi_valid == 16)
      s.pending_buf[s.pending] = (s.bi_buf & 0xff)
      s.pending += 1
      s.pending_buf[s.pending] = (s.bi_buf >> 8)
      s.pending += 1
      s.bi_buf = 0
      s.bi_valid = 0
    elsif (s.bi_valid >= 8)
      s.pending_buf[s.pending] = s.bi_buf
      s.pending += 1
      s.bi_buf >>= 8
      s.bi_valid -= 8
    end
  end
def bi_flush ( s ) if ( s . bi_valid == 16 ) s . pending_buf [ s . pending ] = ( s . bi_buf & 0xff ) s . pending += 1 s . pending_buf [ s . pending ] = ( s . bi_buf >> 8 ) s . pending += 1 s . bi_buf = 0 s . bi_valid = 0 elsif ( s . bi_valid >= 8 ) s . pending_buf [ s . pending ] = s . bi_buf s . pending += 1 s . bi_buf >>= 8 s . bi_valid -= 8 end end
Flush the bit buffer, keeping at most 7 bits in it.
Flush the bit buffer keeping at most 7 bits in it .
s
<not_specific>