before opti

This commit is contained in:
2025-06-12 16:21:11 +02:00
parent c57dbe080b
commit f5d951862a

5
main.c
View File

@@ -30,7 +30,7 @@ void newPerson(person *p, const char *name) {
}
void insert(person **head, person *node) {
if (head == NULL) {
if (*head == NULL) {
*head = node;
} else {
person *p = *head;
@@ -122,7 +122,7 @@ u_long hash(const unsigned char *str) {
}
void hm_insert(person **hashmap, char *name) {
u_long hash_value = hash(name);
u_long hash_value = hash((unsigned char *)name);
hash_value = hash_value % HASH_BUCKETS;
sorted_name_insert(&hashmap[hash_value], name);
}
@@ -187,6 +187,7 @@ void make_list(person **hashmap, person **list, const int min_count) {
}
p = p_next;
}
hashmap[i] = NULL;
}
free(hashmap);
}