src/ucx/hash_map.c

changeset 484
c036a8b242a8
parent 438
22eca559aded
child 490
d218607f5a7e
equal deleted inserted replaced
483:f69d88f86b9c 484:c036a8b242a8
300 iter.base.remove = false; 300 iter.base.remove = false;
301 iter.base.mutating = false; 301 iter.base.mutating = false;
302 302
303 iter.slot = 0; 303 iter.slot = 0;
304 iter.index = 0; 304 iter.index = 0;
305 305
306 if (map->size > 0) { 306 if (map->size > 0) {
307 struct cx_hash_map_s *hash_map = (struct cx_hash_map_s *) map; 307 struct cx_hash_map_s *hash_map = (struct cx_hash_map_s *) map;
308 struct cx_hash_map_element_s *elm = hash_map->buckets[0]; 308 struct cx_hash_map_element_s *elm = hash_map->buckets[0];
309 for (; elm == NULL; iter.slot++) { 309 while (elm == NULL) {
310 elm = hash_map->buckets[iter.slot]; 310 elm = hash_map->buckets[++iter.slot];
311 } 311 }
312 iter.elem_handle = elm; 312 iter.elem_handle = elm;
313 iter.kv_data.key = &elm->key; 313 iter.kv_data.key = &elm->key;
314 // TODO: pointer to data if this map is storing copies 314 // TODO: pointer to data if this map is storing copies
315 iter.kv_data.value = elm->data; 315 iter.kv_data.value = elm->data;

mercurial