]> pd.if.org Git - nbds/blobdiff - map/list.c
fix error in validation logic
[nbds] / map / list.c
index e900f0203229c8d52618b6d2fa1c499b096d0c53..0982e59810bab669599a20583e52cb9df9768f69 100644 (file)
@@ -10,7 +10,6 @@
 #include <string.h>
 
 #include "common.h"
-#include "mlocal.h"
 #include "list.h"
 #include "mem.h"
 
@@ -25,13 +24,6 @@ struct ll {
     const datatype_t *key_type;
 };
 
-static const map_impl_t ll_map_impl = { 
-    (map_alloc_t)ll_alloc, (map_cas_t)ll_cas, (map_get_t)ll_lookup, (map_remove_t)ll_remove, 
-    (map_count_t)ll_count, (map_print_t)ll_print, (map_free_t)ll_free
-};
-
-const map_impl_t *MAP_TYPE_LIST = &ll_map_impl;
-
 static node_t *node_alloc (void *key, uint64_t val) {
     node_t *item = (node_t *)nbd_malloc(sizeof(node_t));
     item->key = key;
@@ -60,7 +52,9 @@ uint64_t ll_count (list_t *ll) {
     uint64_t count = 0;
     node_t *item = ll->head->next;
     while (item) {
-        count++;
+        if (!IS_TAGGED(item->next)) {
+            count++;
+        }
         item = (node_t *)STRIP_TAG(item->next);
     }
     return count;