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.
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.For technical reasons, it is more efficient to use testBit() and setBit() to access bits in the array than operator[]().
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks