lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
# Reverse the first len bits of a code, using straightforward code (a faster
# method would use a table)
# IN assertion: 1 <= len <= 15
Reverse the first len bits of a code, using straightforward code (a faster
method would use a table)
IN assertion: 1 <= len <= 15
Reverse the first len bits of a code using straightforward code ( a faster method would use a table ) IN assertion : 1 < = len < = 15
def bi_reverse(code,len)
    res = 0
    loop do
      res |= (code & 1)
      code >>= 1
      res <<= 1
      len -= 1
      break if len<=0
    end
    res >> 1
  end
def bi_reverse ( code , len ) res = 0 loop do res |= ( code & 1 ) code >>= 1 res <<= 1 len -= 1 break if len <= 0 end res >> 1 end
Reverse the first len bits of a code, using straightforward code (a faster
method would use a table)
IN assertion: 1 <= len <= 15
Reverse the first len bits of a code using straightforward code ( a faster method would use a table ) IN assertion : 1 < = len < = 15
code
<not_specific>
len
<not_specific>