MCPcopy Create free account
hub / github.com/ElementsProject/elements / FindNextUserEntry

Method FindNextUserEntry

src/leveldb/db/db_iter.cc:177–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void DBIter::FindNextUserEntry(bool skipping, std::string* skip) {
178 // Loop until we hit an acceptable entry to yield
179 assert(iter_->Valid());
180 assert(direction_ == kForward);
181 do {
182 ParsedInternalKey ikey;
183 if (ParseKey(&ikey) && ikey.sequence <= sequence_) {
184 switch (ikey.type) {
185 case kTypeDeletion:
186 // Arrange to skip all upcoming entries for this key since
187 // they are hidden by this deletion.
188 SaveKey(ikey.user_key, skip);
189 skipping = true;
190 break;
191 case kTypeValue:
192 if (skipping &&
193 user_comparator_->Compare(ikey.user_key, *skip) <= 0) {
194 // Entry hidden
195 } else {
196 valid_ = true;
197 saved_key_.clear();
198 return;
199 }
200 break;
201 }
202 }
203 iter_->Next();
204 } while (iter_->Valid());
205 saved_key_.clear();
206 valid_ = false;
207}
208
209void DBIter::Prev() {
210 assert(valid_);

Callers

nothing calls this directly

Calls 4

ValidMethod · 0.45
CompareMethod · 0.45
clearMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected