aboutsummaryrefslogtreecommitdiff
path: root/src/dbwrapper.h
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2023-07-28 22:53:50 +0200
committerTheCharlatan <seb.kung@gmail.com>2023-08-05 10:42:45 +0200
commitd7437908cdf242626263ba9d5541addcddadc594 (patch)
treed3b8b3d6cfd3f1b195e26043b7c1f0777ae12a48 /src/dbwrapper.h
parentea8135de7e617259cda3fc7b1c8e7569d454fd57 (diff)
downloadbitcoin-d7437908cdf242626263ba9d5541addcddadc594.tar.xz
refactor: Split dbwrapper CDBIterator::Seek implementation
Keep the generic serialization in the header, while moving leveldb-specifics to the implementation file. The context of this commit is an effort to decouple the dbwrapper header file from leveldb includes. To this end, the includes are moved to the dbwrapper implementation file. This is done as part of the kernel project to reduce the number of required includes for users of the kernel.
Diffstat (limited to 'src/dbwrapper.h')
-rw-r--r--src/dbwrapper.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dbwrapper.h b/src/dbwrapper.h
index 9016111209..aa2b31b160 100644
--- a/src/dbwrapper.h
+++ b/src/dbwrapper.h
@@ -140,6 +140,8 @@ private:
const CDBWrapper &parent;
leveldb::Iterator *piter;
+ void SeekImpl(Span<const std::byte> ssKey);
+
public:
/**
@@ -158,8 +160,7 @@ public:
DataStream ssKey{};
ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
ssKey << key;
- leveldb::Slice slKey(CharCast(ssKey.data()), ssKey.size());
- piter->Seek(slKey);
+ SeekImpl(ssKey);
}
void Next();