summaryrefslogtreecommitdiff
path: root/db/dbformat.h
diff options
context:
space:
mode:
authorChris Mumford <cmumford@google.com>2019-05-09 08:37:48 -0700
committerChris Mumford <cmumford@google.com>2019-05-09 08:37:49 -0700
commit1aae5c9f29ea43ceca745efae012c4aa731e9374 (patch)
tree625885997cfedfa19d65e4ba990c7d4ebd67e7b0 /db/dbformat.h
parentb7b86baec9ce47569affc5db54a20a6cc520e0f0 (diff)
parent7d060117fa0d5cab7cb15b0cf127533bea9ffbc7 (diff)
downloadleveldb-1aae5c9f29ea43ceca745efae012c4aa731e9374.tar.gz
Merge pull request #411 from proller:assert1
PiperOrigin-RevId: 247424040
Diffstat (limited to 'db/dbformat.h')
-rw-r--r--db/dbformat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/db/dbformat.h b/db/dbformat.h
index 013028a..f990040 100644
--- a/db/dbformat.h
+++ b/db/dbformat.h
@@ -139,7 +139,11 @@ class InternalKey {
AppendInternalKey(&rep_, ParsedInternalKey(user_key, s, t));
}
- void DecodeFrom(const Slice& s) { rep_.assign(s.data(), s.size()); }
+ bool DecodeFrom(const Slice& s) {
+ rep_.assign(s.data(), s.size());
+ return !rep_.empty();
+ }
+
Slice Encode() const {
assert(!rep_.empty());
return rep_;