MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetVarint32

Function GetVarint32

src/leveldb/util/coding.cc:104–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104bool GetVarint32(Slice* input, uint32_t* value) {
105 const char* p = input->data();
106 const char* limit = p + input->size();
107 const char* q = GetVarint32Ptr(p, limit, value);
108 if (q == nullptr) {
109 return false;
110 } else {
111 *input = Slice(q, limit - q);
112 return true;
113 }
114}
115
116const char* GetVarint64Ptr(const char* p, const char* limit, uint64_t* value) {
117 uint64_t result = 0;

Callers 3

GetLengthPrefixedSliceFunction · 0.85
GetLevelFunction · 0.85
DecodeFromMethod · 0.85

Calls 4

GetVarint32PtrFunction · 0.85
SliceClass · 0.70
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected