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

Method Get

libs/coding/fixed_bits_ddvector.hpp:91–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 bool Get(TSize index, TValue & value) const
92 {
93 ASSERT_LESS(index, m_size, ());
94 uint64_t const bitsOffset = index * Bits;
95
96 uint64_t bytesOffset = bitsOffset / CHAR_BIT;
97 size_t constexpr kBlockSize = sizeof(TBlock);
98 if (bytesOffset + kBlockSize > m_bits.Size())
99 bytesOffset = m_bits.Size() - kBlockSize;
100
101 TBlock v = ReadPrimitiveFromPos<TBlock>(m_bits, bytesOffset);
102 v >>= (bitsOffset - bytesOffset * CHAR_BIT);
103 v &= kMask;
104 if (v == kUndefined)
105 return false;
106
107 value = v < kLargeValue ? v : FindInVector(index);
108 return true;
109 }
110
111 template <class TWriter>
112 class Builder

Callers

nothing calls this directly

Calls 1

SizeMethod · 0.45

Tested by

no test coverage detected