mirror of https://gitee.com/bigwinds/arangodb
Follow coding style guidelines a bit more. Add nrUsed count.
This commit is contained in:
parent
e3c0059211
commit
c8b8af36b2
|
@ -233,6 +233,7 @@ TRI_skiplist_t* TRI_InitSkipList(TRI_skiplist_compare_func_t cmpfunc,
|
|||
sl->compare = cmpfunc;
|
||||
sl->free = freefunc;
|
||||
sl->unique = unique;
|
||||
sl->nrUsed = 0;
|
||||
|
||||
return sl;
|
||||
}
|
||||
|
@ -341,6 +342,8 @@ int TRI_SkipListInsert(TRI_skiplist_t *sl, void *doc) {
|
|||
pos[lev]->next[lev] = new;
|
||||
}
|
||||
|
||||
sl->nrUsed++;
|
||||
|
||||
return TRI_ERROR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
@ -385,6 +388,8 @@ int TRI_SkipListRemove(TRI_skiplist_t *sl, void *doc) {
|
|||
|
||||
TRI_SkipListFreeNode(next);
|
||||
|
||||
sl->nrUsed--;
|
||||
|
||||
return TRI_ERROR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ typedef struct TRI_skiplist_s {
|
|||
TRI_skiplist_free_func_t free;
|
||||
bool unique; // indicates whether multiple entries that
|
||||
// are equal in the preorder are allowed in
|
||||
uint64_t nrUsed;
|
||||
} TRI_skiplist_t;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue