mirror of https://gitee.com/bigwinds/arangodb
attempt to fix PrimaryIndexIterator::nextBabies()
This commit is contained in:
parent
e82ed380e6
commit
a624ea4ec5
|
@ -93,6 +93,25 @@ TRI_doc_mptr_t* PrimaryIndexIterator::next() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void PrimaryIndexIterator::nextBabies(std::vector<TRI_doc_mptr_t*>& buffer, size_t limit) {
|
||||
size_t atMost = limit;
|
||||
|
||||
buffer.clear();
|
||||
|
||||
while (_iterator.valid() && atMost > 0) {
|
||||
auto result = _index->lookup(_trx, _iterator.value());
|
||||
_iterator.next();
|
||||
|
||||
if (result == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
buffer.emplace_back(result);
|
||||
--atMost;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrimaryIndexIterator::reset() { _iterator.reset(); }
|
||||
|
||||
TRI_doc_mptr_t* AllIndexIterator::next() {
|
||||
|
@ -102,6 +121,23 @@ TRI_doc_mptr_t* AllIndexIterator::next() {
|
|||
return _index->findSequential(_trx, _position, _total);
|
||||
};
|
||||
|
||||
void AllIndexIterator::nextBabies(std::vector<TRI_doc_mptr_t*>& buffer, size_t limit) {
|
||||
size_t atMost = limit;
|
||||
|
||||
buffer.clear();
|
||||
|
||||
while (atMost > 0) {
|
||||
auto result = next();
|
||||
|
||||
if (result == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
buffer.emplace_back(result);
|
||||
--atMost;
|
||||
}
|
||||
}
|
||||
|
||||
void AllIndexIterator::reset() { _position.reset(); }
|
||||
|
||||
TRI_doc_mptr_t* AnyIndexIterator::next() {
|
||||
|
|
|
@ -56,6 +56,8 @@ class PrimaryIndexIterator final : public IndexIterator {
|
|||
~PrimaryIndexIterator() {}
|
||||
|
||||
TRI_doc_mptr_t* next() override;
|
||||
|
||||
void nextBabies(std::vector<TRI_doc_mptr_t*>&, size_t) override;
|
||||
|
||||
void reset() override;
|
||||
|
||||
|
@ -79,6 +81,8 @@ class AllIndexIterator final : public IndexIterator {
|
|||
~AllIndexIterator() {}
|
||||
|
||||
TRI_doc_mptr_t* next() override;
|
||||
|
||||
void nextBabies(std::vector<TRI_doc_mptr_t*>&, size_t) override;
|
||||
|
||||
void reset() override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue