Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated H_DEFAULT_CAPACITY to be HS and HT respectively. #1

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hash_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "prime.h"
#include "strdup/strdup.h"

static const int H_DEFAULT_CAPACITY = 50;
static const int HS_DEFAULT_CAPACITY = 50;

/**
* Resize the hash set. This implementation has a set capacity;
Expand Down Expand Up @@ -83,7 +83,7 @@ static void hs_delete_key(char *r) { free(r); }

hash_set *hs_init(int base_capacity) {
if (!base_capacity) {
base_capacity = H_DEFAULT_CAPACITY;
base_capacity = HS_DEFAULT_CAPACITY;
}

hash_set *hs = malloc(sizeof(hash_set));
Expand Down
4 changes: 2 additions & 2 deletions src/hash_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

static ht_record HT_RECORD_SENTINEL = {NULL, NULL};

const int H_DEFAULT_CAPACITY = 50;
const int HT_DEFAULT_CAPACITY = 50;

static void __ht_insert(hash_table *ht, const char *key, void *value,
bool free_value);
Expand Down Expand Up @@ -194,7 +194,7 @@ static void __ht_delete_table(hash_table *ht, bool free_value) {

hash_table *ht_init(int base_capacity) {
if (!base_capacity) {
base_capacity = H_DEFAULT_CAPACITY;
base_capacity = HT_DEFAULT_CAPACITY;
}

hash_table *ht = malloc(sizeof(hash_table));
Expand Down