X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhtable%2Ftools%2Fspeed.c;h=194f11201f01c9d08aa5647f4a8436c1175a03de;hp=72a08e6b4cd1e253b14436e644d5ab5d5608739f;hb=f725bbb1987284933e0f21dfb8f2ce7a1f0806e5;hpb=78e983a7a6e5250ebf963d5d93fe34c1d27d5a39 diff --git a/ccan/htable/tools/speed.c b/ccan/htable/tools/speed.c index 72a08e6b..194f1120 100644 --- a/ccan/htable/tools/speed.c +++ b/ccan/htable/tools/speed.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -28,9 +29,9 @@ static size_t hash_obj(const unsigned int *key) return hashl(key, 1, 0); } -static bool cmp(const unsigned int *key1, const unsigned int *key2) +static bool cmp(const struct object *object, const unsigned int *key) { - return *key1 == *key2; + return object->key == *key; } HTABLE_DEFINE_TYPE(struct object, objkey, hash_obj, cmp, obj); @@ -330,7 +331,7 @@ int main(int argc, char *argv[]) fflush(stdout); gettimeofday(&start, NULL); for (i = 0; i < num; i++) { - unsigned int n = num * 6 + i * 9; + unsigned int n = num * (5 + 9) + i * 9; if (htable_obj_get(ht, &n)) abort(); }