refactor: some small stuff

This commit is contained in:
Jef Roosens 2022-12-03 13:27:34 +01:00
parent f9a5fc14e5
commit 2d89c5e80f
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
3 changed files with 10 additions and 8 deletions

View file

@ -71,7 +71,7 @@ char** init_string_matrix(int count, int len) {
* @param size_func function to get the size of the given trie
* @return exit code describing failures, if any
*/
int fuzzy_test_trie_seed(FuzzyConfig conf, void* (*init_func) (), void (*free_func) (void*), bool (*add_func) (void*, char*), bool (*remove_func) (void*, char*), size_t (*size_func) (void*)) {
int fuzzy_test_trie_seed(FuzzyConfig conf, void* (*init_func) (), void (*free_func) (void*), bool (*add_func) (void*, char*, void*), bool (*remove_func) (void*, char*), size_t (*size_func) (void*)) {
srand(conf.seed);
char** matrix = init_string_matrix(conf.word_count, conf.word_length);
@ -110,7 +110,7 @@ int fuzzy_test_trie_seed(FuzzyConfig conf, void* (*init_func) (), void (*free_fu
// Add all strings to trie, checking for duplicates
for (int i = 0; i < conf.word_count; i++) {
changed = add_func(ct, matrix[i]);
changed = add_func(ct, matrix[i], NULL);
// if changed is false, *contains_dedupped[i] should be true, as changed
// can only be false if the string is already contained in the trie. if