feat: put dup record in the last

This commit is contained in:
Cary Xu 2022-05-19 09:23:15 +08:00
parent e0f53dfc32
commit 54420f06fc
2 changed files with 3 additions and 3 deletions

View File

@ -56,10 +56,10 @@ typedef enum { SSkipListPutSuccess = 0, SSkipListPutEarlyStop = 1, SSkipListPutS
typedef struct SSkipList {
uint32_t seed;
uint16_t len;
__compar_fn_t comparFn;
__sl_key_fn_t keyFn;
TdThreadRwlock *lock;
uint16_t len;
uint8_t maxLevel;
uint8_t flags;
uint8_t type; // static info above

View File

@ -185,10 +185,10 @@ void tSkipListPutBatchByIter(SSkipList *pSkipList, void *iter, iter_next_fn_t it
pKey = SL_GET_NODE_KEY(pSkipList, p);
compare = pSkipList->comparFn(pKey, pDataKey);
if (compare >= 0) {
if (compare == 0 && !hasDup) hasDup = true;
if (compare > 0) {
break;
} else {
if (compare == 0 && !hasDup) hasDup = true;
px = p;
p = SL_NODE_GET_FORWARD_POINTER(px, i);
}