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;
|
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(); }
|
void PrimaryIndexIterator::reset() { _iterator.reset(); }
|
||||||
|
|
||||||
TRI_doc_mptr_t* AllIndexIterator::next() {
|
TRI_doc_mptr_t* AllIndexIterator::next() {
|
||||||
|
@ -102,6 +121,23 @@ TRI_doc_mptr_t* AllIndexIterator::next() {
|
||||||
return _index->findSequential(_trx, _position, _total);
|
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(); }
|
void AllIndexIterator::reset() { _position.reset(); }
|
||||||
|
|
||||||
TRI_doc_mptr_t* AnyIndexIterator::next() {
|
TRI_doc_mptr_t* AnyIndexIterator::next() {
|
||||||
|
|
|
@ -57,6 +57,8 @@ class PrimaryIndexIterator final : public IndexIterator {
|
||||||
|
|
||||||
TRI_doc_mptr_t* next() override;
|
TRI_doc_mptr_t* next() override;
|
||||||
|
|
||||||
|
void nextBabies(std::vector<TRI_doc_mptr_t*>&, size_t) override;
|
||||||
|
|
||||||
void reset() override;
|
void reset() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -80,6 +82,8 @@ class AllIndexIterator final : public IndexIterator {
|
||||||
|
|
||||||
TRI_doc_mptr_t* next() override;
|
TRI_doc_mptr_t* next() override;
|
||||||
|
|
||||||
|
void nextBabies(std::vector<TRI_doc_mptr_t*>&, size_t) override;
|
||||||
|
|
||||||
void reset() override;
|
void reset() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue