class Hamster::Vector

def flatten_node(node, bitshift, result)

def flatten_node(node, bitshift, result)
  if bitshift == 0
    result.concat(node)
  elsif bitshift == BITS_PER_LEVEL
    node.each { |a| result.concat(a) }
  else
    bitshift -= BITS_PER_LEVEL
    node.each { |a| flatten_node(a, bitshift, result) }
  end
  result
end