How fast do it?
I must iterate over all bits?
It will be faster if will possible bits treat at 32 or even 64 bit chunks.
Printable View
How fast do it?
I must iterate over all bits?
It will be faster if will possible bits treat at 32 or even 64 bit chunks.
I am sure that the internal implementation of QBitArray::testBit() is optimized for this type of operation. Just iterate over the bits from beginning to end or vice-versa. Anything you try to do to optimize this yourself will probably be slower.
And as the documentation says:
It would be better to focus on the important parts of your application rather than trying to rewrite basic Qt classes.Quote:
For technical reasons, it is more efficient to use testBit() and setBit() to access bits in the array than operator[]().