MCPcopy Create free account
hub / github.com/Tencent/MMKV / pbRawVarint32Size

Function pbRawVarint32Size

Core/PBUtility.cpp:25–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace mmkv {
24
25uint32_t pbRawVarint32Size(uint32_t value) {
26 if ((value & (0xffffffff << 7)) == 0) {
27 return 1;
28 } else if ((value & (0xffffffff << 14)) == 0) {
29 return 2;
30 } else if ((value & (0xffffffff << 21)) == 0) {
31 return 3;
32 } else if ((value & (0xffffffff << 28)) == 0) {
33 return 4;
34 }
35 return 5;
36}
37
38uint32_t pbUInt64Size(uint64_t value) {
39 if ((value & (0xffffffffffffffffL << 7)) == 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected