1
0
Fork 0

Speed up skiplist removal if many keys are equal.

This commit is contained in:
Max Neunhoeffer 2013-11-07 14:10:38 +01:00
parent 99d9f6db1b
commit bae553fc22
1 changed files with 6 additions and 0 deletions

View File

@ -424,7 +424,13 @@ static int IndexStaticMultiCompareElementElement (TRI_skiplist_multi_t* multiSki
}
}
// We break this tie in the key comparison by looking at the key:
compareResult = strcmp(leftElement->_document->_key,rightElement->_document->_key);
if (compareResult < 0) return TRI_SKIPLIST_COMPARE_STRICTLY_LESS;
else if (compareResult > 0) return TRI_SKIPLIST_COMPARE_STRICTLY_GREATER;
// This will actually never be reached since the keys can only be
// the same if the documents are, which has been checked above.
return defaultEqual;
}