Inline a couple of functions and put one save lazily clearing

Summary:
Machine several functions inline.
Also, in DBIter.Seek() make value cleaning up lazily done.
These are for the use case that Seek() are called lots of times but few return values.

Test Plan: make all check

Differential Revision: https://reviews.facebook.net/D14217
main
Siying Dong 11 years ago
parent 15b31b57df
commit 071fb0d77b
  1. 4
      db/db_iter.cc

@ -426,13 +426,13 @@ void DBIter::FindPrevUserEntry() {
}
void DBIter::Seek(const Slice& target) {
direction_ = kForward;
ClearSavedValue();
saved_key_.clear();
AppendInternalKey(
&saved_key_, ParsedInternalKey(target, sequence_, kValueTypeForSeek));
iter_->Seek(saved_key_);
if (iter_->Valid()) {
direction_ = kForward;
ClearSavedValue();
FindNextUserEntry(false /*not skipping */);
} else {
valid_ = false;

Loading…
Cancel
Save