normed: output directory
This commit is contained in:
parent
7bb95e24a6
commit
3d11b63428
37 changed files with 692 additions and 708 deletions
19
output/src/hashmap/env/env_clone.c
vendored
19
output/src/hashmap/env/env_clone.c
vendored
|
|
@ -10,24 +10,21 @@
|
|||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/hashmap/hashmap_env.h"
|
||||
#include "me/types.h"
|
||||
|
||||
#include "me/hashmap/hashmap_env.h"
|
||||
|
||||
|
||||
|
||||
t_error hmap_env_clone(t_hashmap_env *self,
|
||||
t_error (*clone)(const t_kv_env *val, void *ctx, t_kv_env *out),
|
||||
void *ctx,
|
||||
t_hashmap_env **out)
|
||||
t_error hmap_env_clone(t_hashmap_env *self,
|
||||
t_error (*clone)(const t_kv_env *val, void *ctx, t_kv_env *out),
|
||||
void *ctx, t_hashmap_env **out)
|
||||
{
|
||||
t_usize bucket_id;
|
||||
t_usize bucket_id;
|
||||
t_entry_env *cur;
|
||||
t_kv_env kv;
|
||||
t_hashmap_env *ret;
|
||||
|
||||
bucket_id = 0;
|
||||
ret = hmap_env_new_with_buckets(self->hfunc, self->cfunc, self->free, self->num_buckets);
|
||||
ret = hmap_env_new_with_buckets(self->hfunc, self->cfunc, self->free,
|
||||
self->num_buckets);
|
||||
if (ret == NULL)
|
||||
return (ERROR);
|
||||
while (bucket_id < self->num_buckets)
|
||||
|
|
@ -36,7 +33,7 @@ t_error hmap_env_clone(t_hashmap_env *self,
|
|||
while (cur != NULL)
|
||||
{
|
||||
if (clone(&cur->kv, ctx, &kv))
|
||||
return (hmap_env_free(ret),ERROR);
|
||||
return (hmap_env_free(ret), ERROR);
|
||||
hmap_env_insert(ret, kv.key, kv.val);
|
||||
cur = cur->next;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue