From 48c798de3fe94a5960f6d9f59def2f2df559562a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 17 Jan 2018 20:15:13 -0800 Subject: [PATCH] ircd::db: Add size() participant for rocksdb::Slice. --- include/ircd/db/db.h | 1 + ircd/db.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/ircd/db/db.h b/include/ircd/db/db.h index 70e4c6e20..14d574ff5 100644 --- a/include/ircd/db/db.h +++ b/include/ircd/db/db.h @@ -94,6 +94,7 @@ namespace ircd::db rocksdb::Slice slice(const string_view &); string_view slice(const rocksdb::Slice &); + size_t size(const rocksdb::Slice &); bool valid(const rocksdb::Iterator &); string_view key(const rocksdb::Iterator &); diff --git a/ircd/db.cc b/ircd/db.cc index 9b2ce9d55..c11053c2a 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -4290,6 +4290,12 @@ ircd::db::val(const rocksdb::Iterator &it) return slice(it.value()); } +size_t +ircd::db::size(const rocksdb::Slice &slice) +{ + return slice.size(); +} + rocksdb::Slice ircd::db::slice(const string_view &sv) {