This way, the number of loop iterations is equal to the number of set bits in the bitset rather than the number of bits in the bitset, which is a good improvement because usually very few bits are set.