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

Function GetLengthPrefixedSlice

src/leveldb/util/coding.cc:145–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145const char* GetLengthPrefixedSlice(const char* p, const char* limit,
146 Slice* result) {
147 uint32_t len;
148 p = GetVarint32Ptr(p, limit, &len);
149 if (p == nullptr) return nullptr;
150 if (p + len > limit) return nullptr;
151 *result = Slice(p, len);
152 return p + len;
153}
154
155bool GetLengthPrefixedSlice(Slice* input, Slice* result) {
156 uint32_t len;

Callers 1

TESTFunction · 0.70

Calls 5

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

Tested by 1

TESTFunction · 0.56