Changes in uspace/app/hbench/env.c [0db0df2:68655bc2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hbench/env.c
r0db0df2 r68655bc2 34 34 */ 35 35 36 #include <adt/hash.h>37 36 #include <stdlib.h> 38 37 #include <stdio.h> … … 43 42 ht_link_t link; 44 43 45 size_t hash;46 44 char *key; 47 45 char *value; … … 51 49 { 52 50 param_t *param = hash_table_get_inst(item, param_t, link); 53 return param->hash;51 return str_size(param->key); 54 52 } 55 53 56 54 static size_t param_key_hash(const void *key) 57 55 { 58 return hash_string(key); 56 const char *key_str = key; 57 return str_size(key_str); 59 58 } 60 59 61 static bool param_key_equal(const void *key, size_t hash,const ht_link_t *item)60 static bool param_key_equal(const void *key, const ht_link_t *item) 62 61 { 63 62 param_t *param = hash_table_get_inst(item, param_t, link); 63 const char *key_str = key; 64 64 65 if (param->hash != hash)66 return false;67 68 const char *key_str = key;69 65 return str_cmp(param->key, key_str) == 0; 70 66 } … … 75 71 param_t *b = hash_table_get_inst(link_b, param_t, link); 76 72 77 return a->hash == b->hash &&str_cmp(a->key, b->key) == 0;73 return str_cmp(a->key, b->key) == 0; 78 74 } 79 75 … … 120 116 param->key = str_dup(key); 121 117 param->value = str_dup(value); 122 param->hash = hash_string(key);123 118 124 119 if ((param->key == NULL) || (param->value == NULL)) { … … 137 132 const char *bench_env_param_get(bench_env_t *env, const char *key, const char *default_value) 138 133 { 139 ht_link_t *item = hash_table_find(&env->parameters, key);134 ht_link_t *item = hash_table_find(&env->parameters, (char *) key); 140 135 141 136 if (item == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.