1
0
Fork 0

Follow coding style guidelines a bit more. Add nrUsed count.

This commit is contained in:
Max Neunhoeffer 2013-11-18 16:46:56 +01:00
parent e3c0059211
commit c8b8af36b2
2 changed files with 42 additions and 36 deletions

View File

@ -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;
}

View File

@ -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;