optimized bitset iteration