def resize(new_size)
      return unless @resize_enabled

      bucket_width = new_width # find new bucket width
      local_init(new_size, bucket_width, @last_priority)

      i = 0
      while i < @cached_buckets.size
        bucket = @cached_buckets[i]
        @size -= bucket.size
        while obj = bucket.pop
          self << obj
        end
        i += 1
      end
    end
def resize(new_size)
      return unless @resize_enabled

      bucket_width = new_width # find new bucket width
      local_init(new_size, bucket_width, @last_priority)

      i = 0
      while i < @cached_buckets.size
        bucket = @cached_buckets[i]
        @size -= bucket.size
        while obj = bucket.pop
          self << obj
        end
        i += 1
      end
    end
Resize buckets to new_size.