mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'spdvpk' of ssh://github.com/ArangoDB/ArangoDB into spdvpk
This commit is contained in:
commit
3e27b5b211
|
@ -864,7 +864,9 @@ IndexIterator* HashIndex::iteratorForSlice(arangodb::Transaction* trx,
|
||||||
// Invalid searchValue
|
// Invalid searchValue
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new HashIndexIterator(trx, this, searchValues);
|
auto builder = std::make_unique<VPackBuilder>();
|
||||||
|
builder->add(searchValues);
|
||||||
|
return new HashIndexIterator(trx, this, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -54,14 +54,16 @@ class HashIndexIterator final : public IndexIterator {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
HashIndexIterator(arangodb::Transaction* trx, HashIndex const* index,
|
HashIndexIterator(arangodb::Transaction* trx, HashIndex const* index,
|
||||||
arangodb::velocypack::Slice searchValues)
|
std::unique_ptr<arangodb::velocypack::Builder>& searchValues)
|
||||||
: _trx(trx),
|
: _trx(trx),
|
||||||
_index(index),
|
_index(index),
|
||||||
_searchKeys(searchValues),
|
_searchValues(searchValues.get()),
|
||||||
_position(0),
|
_position(0),
|
||||||
_buffer(),
|
_buffer(),
|
||||||
_posInBuffer(0) {
|
_posInBuffer(0) {
|
||||||
_numLookups = static_cast<size_t>(searchValues.length());
|
searchValues.release(); // now we have ownership for searchValues
|
||||||
|
_searchKeys = _searchValues->slice();
|
||||||
|
_numLookups = static_cast<size_t>(_searchKeys.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
~HashIndexIterator() {
|
~HashIndexIterator() {
|
||||||
|
@ -74,6 +76,7 @@ class HashIndexIterator final : public IndexIterator {
|
||||||
private:
|
private:
|
||||||
arangodb::Transaction* _trx;
|
arangodb::Transaction* _trx;
|
||||||
HashIndex const* _index;
|
HashIndex const* _index;
|
||||||
|
std::unique_ptr<arangodb::velocypack::Builder> _searchValues;
|
||||||
arangodb::velocypack::Slice _searchKeys;
|
arangodb::velocypack::Slice _searchKeys;
|
||||||
size_t _position;
|
size_t _position;
|
||||||
size_t _numLookups;
|
size_t _numLookups;
|
||||||
|
|
Loading…
Reference in New Issue