MCPcopy Create free account
hub / github.com/chen3feng/toft / EncodedLength

Method EncodedLength

encoding/varint.cpp:93–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93int Varint::EncodedLength(uint64_t v) {
94 int len = 1;
95 while (v >= static_cast<uint64_t>(kIncompleteMask)) {
96 v >>= 7;
97 len++;
98 }
99 return len;
100}
101
102int Varint::EncodedLength(const StringPiece& value) {
103 return EncodedLength(value.size()) + static_cast<int>(value.size());

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected