summaryrefslogtreecommitdiff
path: root/db/dbformat.cc
diff options
context:
space:
mode:
Diffstat (limited to 'db/dbformat.cc')
-rw-r--r--db/dbformat.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/db/dbformat.cc b/db/dbformat.cc
index f0bd9d01e..c10f95482 100644
--- a/db/dbformat.cc
+++ b/db/dbformat.cc
@@ -21,6 +21,14 @@ uint64_t PackSequenceAndType(uint64_t seq, ValueType t) {
return (seq << 8) | t;
}
+void UnPackSequenceAndType(uint64_t packed, uint64_t* seq, ValueType* t) {
+ *seq = packed >> 8;
+ *t = static_cast<ValueType>(packed & 0xff);
+
+ assert(*seq <= kMaxSequenceNumber);
+ assert(*t <= kValueTypeForSeek);
+}
+
void AppendInternalKey(std::string* result, const ParsedInternalKey& key) {
result->append(key.user_key.data(), key.user_key.size());
PutFixed64(result, PackSequenceAndType(key.sequence, key.type));