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

Method LookupKey

src/leveldb/db/dbformat.cc:118–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118LookupKey::LookupKey(const Slice& user_key, SequenceNumber s) {
119 size_t usize = user_key.size();
120 size_t needed = usize + 13; // A conservative estimate
121 char* dst;
122 if (needed <= sizeof(space_)) {
123 dst = space_;
124 } else {
125 dst = new char[needed];
126 }
127 start_ = dst;
128 dst = EncodeVarint32(dst, usize + 8);
129 kstart_ = dst;
130 memcpy(dst, user_key.data(), usize);
131 dst += usize;
132 EncodeFixed64(dst, PackSequenceAndType(s, kValueTypeForSeek));
133 dst += 8;
134 end_ = dst;
135}
136
137} // namespace leveldb

Callers

nothing calls this directly

Calls 5

EncodeVarint32Function · 0.85
EncodeFixed64Function · 0.85
PackSequenceAndTypeFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected