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

Function EncodeKey

src/leveldb/db/memtable.cc:39–44  ·  view source on GitHub ↗

Encode a suitable internal key target for "target" and return it. Uses *scratch as scratch space, and the returned pointer will point into this scratch space.

Source from the content-addressed store, hash-verified

37// Uses *scratch as scratch space, and the returned pointer will point
38// into this scratch space.
39static const char* EncodeKey(std::string* scratch, const Slice& target) {
40 scratch->clear();
41 PutVarint32(scratch, target.size());
42 scratch->append(target.data(), target.size());
43 return scratch->data();
44}
45
46class MemTableIterator : public Iterator {
47 public:

Callers 1

SeekMethod · 0.70

Calls 4

PutVarint32Function · 0.85
clearMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected