Use Scala BitSet, which is auto-resizing, avoiding the copy