Function DoFindNext

Synopsis

#include <include/EASTL/bitset.h>

size_type DoFindNext(size_type last_find) const

Description

No description yet.

Source

Lines 1624-1660 in include/EASTL/bitset.h. Line 275 in include/EASTL/bitset.h.

template <typename WordType>
inline typename BitsetBase<2, WordType>::size_type 
BitsetBase<2, WordType>::DoFindNext(size_type last_find) const
{
    // If the last find was in the first word, we must check it and then possibly the second.
    if(++last_find < (size_type)kBitsPerWord)
    {
        // Mask off previous bits of word so our search becomes a "find first".
        word_type this_word = mWord[0] & ((~static_cast<word_type>(0)) << last_find);
        // Step through words.
        size_type fbiw = GetFirstBit(this_word);
        if(fbiw != kBitsPerWord)
            return fbiw;
        fbiw = GetFirstBit(mWord[1]);
        if(fbiw != kBitsPerWord)
            return kBitsPerWord + fbiw;
    }
    else if(last_find < (size_type)(2 * kBitsPerWord))
    {
        // The last find was in the second word, remove the bit count of the first word from the find.
        last_find -= kBitsPerWord;
        // Mask off previous bits of word so our search becomes a "find first".
        word_type this_word = mWord[1] & ((~static_cast<word_type>(0)) << last_find);
        const size_type fbiw = GetFirstBit(this_word);
        if(fbiw != kBitsPerWord)
            return kBitsPerWord + fbiw;
    }
    return 2 * kBitsPerWord;
}





Add Discussion as Guest

Log in