mirror of https://gitee.com/bigwinds/arangodb
fixed invariant
This commit is contained in:
parent
ada372f123
commit
d151088a94
|
@ -564,11 +564,13 @@ int TRI_InsertElementHashArrayMulti (TRI_hash_array_multi_t* array,
|
|||
|
||||
TRI_ASSERT(arrayElement->_next == nullptr);
|
||||
|
||||
// not found in list, now insert insert
|
||||
// not found in list, now insert
|
||||
element->_next = nullptr;
|
||||
*arrayElement = *element;
|
||||
array->_nrUsed++;
|
||||
|
||||
TRI_ASSERT(arrayElement->_next == nullptr);
|
||||
|
||||
return TRI_ERROR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
@ -618,6 +620,7 @@ int TRI_RemoveElementHashArrayMulti (TRI_hash_array_multi_t* array,
|
|||
}
|
||||
|
||||
// the element itself is the document to remove
|
||||
|
||||
if (arrayElement->_next != nullptr) {
|
||||
auto next = arrayElement->_next;
|
||||
|
||||
|
@ -649,6 +652,8 @@ int TRI_RemoveElementHashArrayMulti (TRI_hash_array_multi_t* array,
|
|||
if ((i < k && ! (i < j && j <= k)) || (k < i && ! (i < j || j <= k))) {
|
||||
array->_table[i] = array->_table[k];
|
||||
array->_table[k]._document = nullptr;
|
||||
array->_table[k]._next = nullptr;
|
||||
array->_table[k]._subObjects = nullptr;
|
||||
i = k;
|
||||
}
|
||||
|
||||
|
|
|
@ -490,6 +490,7 @@ int TRI_RemoveElementHashArray (TRI_hash_array_t* array,
|
|||
if ((i < k && ! (i < j && j <= k)) || (k < i && ! (i < j || j <= k))) {
|
||||
array->_table[i] = array->_table[k];
|
||||
array->_table[k]._document = nullptr;
|
||||
array->_table[k]._subObjects = nullptr;
|
||||
i = k;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue