style: noming env_utils
This commit is contained in:
parent
c6f713a6de
commit
7243dd263d
1 changed files with 11 additions and 12 deletions
23
output/src/hashmap/env/env_utils.c
vendored
23
output/src/hashmap/env/env_utils.c
vendored
|
|
@ -1,12 +1,12 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* hashmap_env_utils.c :+: :+: :+: */
|
||||
/* env_utils.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/12/06 10:58:20 by maiboyer #+# #+# */
|
||||
/* Updated: 2023/12/11 15:35:37 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/09/19 15:26:18 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -16,12 +16,11 @@
|
|||
#include "me/types.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
t_str *hmap_env_get(t_hashmap_env *hmap,
|
||||
t_str *key)
|
||||
t_str *hmap_env_get(t_hashmap_env *hmap, t_str *key)
|
||||
{
|
||||
t_usize hashed_key;
|
||||
t_entry_env *entry;
|
||||
t_entry_env *prev;
|
||||
t_usize hashed_key;
|
||||
t_entry_env *entry;
|
||||
t_entry_env *prev;
|
||||
|
||||
hmap->hfunc(&hmap->hasher, key);
|
||||
hashed_key = hasher_reset_and_finish(&hmap->hasher);
|
||||
|
|
@ -31,18 +30,18 @@ t_str *hmap_env_get(t_hashmap_env *hmap,
|
|||
return (&entry->kv.val);
|
||||
}
|
||||
|
||||
void hmap_env_remove(t_hashmap_env *hmap, t_str *key)
|
||||
void hmap_env_remove(t_hashmap_env *hmap, t_str *key)
|
||||
{
|
||||
t_usize hashed_key;
|
||||
t_entry_env *prev;
|
||||
t_entry_env *entry;
|
||||
t_usize hashed_key;
|
||||
t_entry_env *prev;
|
||||
t_entry_env *entry;
|
||||
|
||||
hmap->hfunc(&hmap->hasher, key);
|
||||
hashed_key = hasher_reset_and_finish(&hmap->hasher);
|
||||
prev = NULL;
|
||||
entry = hmap_env_get_entry(hmap, hashed_key, key, &prev);
|
||||
if (entry == NULL)
|
||||
return;
|
||||
return ;
|
||||
if (prev == NULL)
|
||||
hmap->buckets[hashed_key % hmap->num_buckets] = entry->next;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue