diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-30 22:26:36 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-30 22:26:36 +0200 |
| commit | 901402c99018422c994bdb297e3ba404969c88ea (patch) | |
| tree | 98602c73a00af57fb7efcb36e4e3cbae2c0ce3a8 /src/ht/ft_htget.c | |
| parent | 40ed37c023627726a5c9c6928284e9f042dc0fa4 (diff) | |
| download | libft-901402c99018422c994bdb297e3ba404969c88ea.tar.gz libft-901402c99018422c994bdb297e3ba404969c88ea.tar.bz2 libft-901402c99018422c994bdb297e3ba404969c88ea.zip | |
Added documentation for ht and lst
Diffstat (limited to 'src/ht/ft_htget.c')
| -rw-r--r-- | src/ht/ft_htget.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ht/ft_htget.c b/src/ht/ft_htget.c index 94a4164..6b5df48 100644 --- a/src/ht/ft_htget.c +++ b/src/ht/ft_htget.c @@ -13,9 +13,11 @@ #include "libft.h" #include "libft_ht.h" -/* -** Retrieve a value with associated key. -** Returns NULL if there is no value at `key`. +/** +** \brief Retrieve a value with a key +** \param ht Hash table where key is searched +** \param key Searched key +** \return Value void pointer at key or NULL if not found */ void *ft_htget(t_ftht *ht, char *key) @@ -27,8 +29,8 @@ void *ft_htget(t_ftht *ht, char *key) if (ht == NULL || key == NULL) return (NULL); digest = ft_hthash(ht, key); - found = ft_lstlfind(ht->entries[digest], ft_inter_htkey_cmp, key); + found = ft_lstlfind(ht->buckets[digest], ft_inter_htkey_cmp, key); if (found == NULL) return (NULL); - return (((t_ftht_content*)found->content)->value); + return (((t_ftht_entry*)found->data)->value); } |
