MCPcopy Create free account
hub / github.com/comaps/comaps / ReadVarUInt32SortedShortArray

Function ReadVarUInt32SortedShortArray

libs/coding/varint.hpp:329–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327/// ArrayByteSource isn't as fast as pointers :)
328template <class Source, class ContT>
329void ReadVarUInt32SortedShortArray(Source & src, ContT & cont)
330{
331 cont.clear();
332
333 bool hasNext = false;
334 uint32_t prev = 0;
335 do
336 {
337 uint32_t const v = ReadVarUint<uint32_t>(src);
338 hasNext = (v & 0x1) != 0;
339
340 prev += (v >> 1);
341 cont.push_back(prev);
342 }
343 while (hasNext);
344}
345/// @}

Callers 3

UNIT_TESTFunction · 0.85
ReadMethod · 0.85
ParseRelationsMethod · 0.85

Calls 2

clearMethod · 0.45
push_backMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.68