From 8946fa4b77fef3002d78bb1c5a19cc05c97a71c3 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 22 Mar 2025 15:07:31 +0200 Subject: make map faster --- tests/map.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/map.c') diff --git a/tests/map.c b/tests/map.c index e9362ab..08f831e 100644 --- a/tests/map.c +++ b/tests/map.c @@ -3,13 +3,16 @@ #define MAP_KEY int #define MAP_TYPE int +#define MAP_HASH(a) CONTS_MAP_NO_HASH(a) #define MAP_CMP(a, b) ((a) - (b)) #define MAP_NAME ints #include int main() { - struct ints ints = ints_create(); + /* heuristic, but if we know how many elements we'll need, we should + * give it to the create function. */ + struct ints ints = ints_create(0); for (int i = 0; i < 1000000; ++i) { ints_insert(&ints, i, i); } -- cgit v1.2.3