1
0
Fork 0

Fix unit tests with latest hash index changes.

This commit is contained in:
Max Neunhoeffer 2015-06-17 15:09:14 +02:00
parent dac7fb06e0
commit f279bf5778
1 changed files with 17 additions and 9 deletions

View File

@ -504,7 +504,7 @@ int HashIndex::lookup (TRI_index_search_value_t* searchValue,
std::vector<TRI_hash_index_element_t*>* results = nullptr; std::vector<TRI_hash_index_element_t*>* results = nullptr;
if (next != nullptr) { if (next == nullptr) {
try { try {
results = _multi._hashArray->lookupByKey(searchValue, batchSize); results = _multi._hashArray->lookupByKey(searchValue, batchSize);
} }
@ -522,17 +522,25 @@ int HashIndex::lookup (TRI_index_search_value_t* searchValue,
} }
if (results != nullptr) { if (results != nullptr) {
next = results->back(); // for continuation the next time if (results->size() > 0) {
try { next = results->back(); // for continuation the next time
for (size_t i = 0; i < results->size(); i++) { try {
documents.emplace_back(*((*results)[i]->_document)); for (size_t i = 0; i < results->size(); i++) {
documents.emplace_back(*((*results)[i]->_document));
}
}
catch (...) {
delete results;
return TRI_ERROR_OUT_OF_MEMORY;
} }
delete results;
} }
catch (...) { else {
delete results; next = nullptr;
return TRI_ERROR_OUT_OF_MEMORY;
} }
delete results;
}
else {
next = nullptr;
} }
return TRI_ERROR_NO_ERROR; return TRI_ERROR_NO_ERROR;
} }