From 27053629d0715ea918c68a08d2d030aae2af8d76 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 22 Apr 2012 15:15:43 +0200 Subject: [PATCH] Let the iter point to the first object. --- src/map.c | 4 ++-- tests/tests.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/map.c b/src/map.c index 01c5046..618b891 100644 --- a/src/map.c +++ b/src/map.c @@ -358,10 +358,10 @@ cfw_map_set(CFWMap *map, void *key, void *obj) void cfw_map_iter(CFWMap *map, cfw_map_iter_t *iter) { - iter->key = NULL; - iter->obj = NULL; iter->_map = map; iter->_pos = 0; + + cfw_map_iter_next(iter); } void diff --git a/tests/tests.c b/tests/tests.c index f493657..75c3359 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -38,7 +38,6 @@ print_map(CFWMap *map) cfw_map_iter_t iter; cfw_map_iter(map, &iter); - cfw_map_iter_next(&iter); fputs("{\n", stdout);