diff --git a/src/inc/tskiplist.h b/src/inc/tskiplist.h index e20dfc613a763e1b9a18d37d7a049cc7d55a21ad..3ebbd5a61064bc4dc0aad34f7ff180998b94e952 100644 --- a/src/inc/tskiplist.h +++ b/src/inc/tskiplist.h @@ -186,8 +186,6 @@ bool tSkipListRemove(tSkipList *pSkipList, tSkipListKey *pKey); */ void tSkipListRemoveNode(tSkipList *pSkipList, tSkipListNode *pNode); -int32_t tSkipListDefaultCompare(tSkipList *pSkipList, tSkipListKey *a, tSkipListKey *b); - // for debug purpose only void tSkipListPrint(tSkipList *pSkipList, int16_t nlevel); diff --git a/src/util/src/tskiplist.c b/src/util/src/tskiplist.c index 861d87b1f5c4ab64da952511628d566923aeae64..81d9779daa72d1999b501c65dd5f025bc3ad0ede 100644 --- a/src/util/src/tskiplist.c +++ b/src/util/src/tskiplist.c @@ -805,41 +805,3 @@ int32_t tSkipListPointQuery(tSkipList *pSkipList, tSkipListKey *pKey, int32_t nu return retLen; } } - -int32_t tSkipListDefaultCompare(tSkipList *pSkipList, tSkipListKey *a, tSkipListKey *b) { - switch (pSkipList->keyType) { - case TSDB_DATA_TYPE_TINYINT: - case TSDB_DATA_TYPE_SMALLINT: - case TSDB_DATA_TYPE_INT: - case TSDB_DATA_TYPE_BIGINT: - case TSDB_DATA_TYPE_BOOL: { - if (a->i64Key == b->i64Key) { - return 0; - } else { - return a->i64Key > b->i64Key ? 1 : -1; - } - }; - case TSDB_DATA_TYPE_FLOAT: - case TSDB_DATA_TYPE_DOUBLE: { - if (fabs(a->dKey - b->dKey) < FLT_EPSILON) { - return 0; - } else { - return a->dKey > b->dKey ? 1 : -1; - } - }; - case TSDB_DATA_TYPE_BINARY: { - if (a->nLen == b->nLen) { - int32_t ret = strncmp(a->pz, b->pz, a->nLen); - if (ret == 0) { - return 0; - } else { - return ret > 0 ? 1 : -1; - } - } else { - return a->nLen > b->nLen ? 1 : -1; - } - }; - } - - return 0; -}