Skip to content

Commit 071fb0d

Browse files
committed
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
1 parent 15b31b5 commit 071fb0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

db/db_iter.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,13 @@ void DBIter::FindPrevUserEntry() {
426426
}
427427

428428
void DBIter::Seek(const Slice& target) {
429-
direction_ = kForward;
430-
ClearSavedValue();
431429
saved_key_.clear();
432430
AppendInternalKey(
433431
&saved_key_, ParsedInternalKey(target, sequence_, kValueTypeForSeek));
434432
iter_->Seek(saved_key_);
435433
if (iter_->Valid()) {
434+
direction_ = kForward;
435+
ClearSavedValue();
436436
FindNextUserEntry(false /*not skipping */);
437437
} else {
438438
valid_ = false;

0 commit comments

Comments
 (0)