MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / readVarInt

Function readVarInt

test/native/protobufBufferTest.cpp:10–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <string.h>
9
10static u64 readVarInt(const unsigned char* data) {
11 size_t idx = 0;
12 u64 output = 0;
13 while (data[idx] & 0x80) {
14 output += ((u64) data[idx] & 0x7F) << (7 * idx);
15 idx++;
16 }
17 return output + ((u64) data[idx] << (7 * idx));
18}
19
20TEST_CASE(Buffer_test_varint_0) {
21 ProtoBuffer buf(100);

Callers 1

TEST_CASEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected