The returned split position shall be the end of the first sub-range, and the start of the second @param splitBit should be initialized with 31, unless you know better. The value can then be used on while computing child split positions. In the end, it will contain the bit used to split the range. It will also contain zero if no split-position exists(length 1)
| 57 | ///@param splitBit should be initialized with 31, unless you know better. The value can then be used on while computing child split positions. |
| 58 | ///In the end, it will contain the bit used to split the range. It will also contain zero if no split-position exists(length 1) |
| 59 | uint splitPositionForRange(uint start, uint end, uchar& splitBit) |
| 60 | { |
| 61 | if (end - start == 1) { |
| 62 | splitBit = 0; |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | while (true) { |
| 67 | uint position = ((end - 1) >> splitBit) << splitBit; //Round to the split-position in this interval that is smaller than end |
| 68 | if (position > start && position < end) |
| 69 | return position; |
| 70 | Q_ASSERT(splitBit != 0); |
| 71 | --splitBit; |
| 72 | } |
| 73 | |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | uint splitPositionForRange(uint start, uint end) |
| 78 | { |
no outgoing calls
no test coverage detected