MCPcopy Create free account
hub / github.com/KDE/kdevelop / splitPositionForRange

Function splitPositionForRange

kdevplatform/language/util/setrepository.cpp:59–75  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)
59uint 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
77uint splitPositionForRange(uint start, uint end)
78{

Callers 7

setForIndicesMethod · 0.85
createItemMethod · 0.85
computeSetFromNodesMethod · 0.85
set_unionMethod · 0.85
set_intersectMethod · 0.85
set_subtractMethod · 0.85
operator()Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected