| 77 | } |
| 78 | |
| 79 | void CharacterSet::initializeBitsets( |
| 80 | const CharacterRange* ranges, size_t length, uint32_t minOffset, uint16_t* offsets, CharacterSet::Bitset* bitsets) { |
| 81 | processCharacters(ranges, length, [&](uint32_t offsetIndex, uint32_t bitsetsCount, uint32_t offsetValue) { |
| 82 | offsets[offsetIndex - minOffset] = bitsetsCount; |
| 83 | |
| 84 | auto& bitset = bitsets[bitsetsCount]; |
| 85 | |
| 86 | auto indexInBitset = offsetValue >> kBitsetShift; |
| 87 | auto valueInBitset = 1 << (offsetValue & kBitsetMask); |
| 88 | |
| 89 | bitset[indexInBitset] |= valueInBitset; |
| 90 | }); |
| 91 | } |
| 92 | |
| 93 | static bool needsSort(const CharacterRange* ranges, size_t length) { |
| 94 | for (size_t i = 1; i < length; i++) { |
nothing calls this directly
no test coverage detected