-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_htfetch.c
27 lines (24 loc) · 1.13 KB
/
ft_htfetch.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_htfetch.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thakala <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/26 12:33:17 by thakala #+# #+# */
/* Updated: 2021/12/26 13:45:11 by thakala ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_htfetch(t_ht *ht, ssize_t seed)
{
t_list *iterator;
iterator = ht->t[ft_hthash(seed, ht->size)];
while (iterator)
{
if (iterator->content_size == seed)
return (iterator->content);
iterator = iterator->next;
}
return (NULL);
}