Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/hbench/env.c

    r0db0df2 r68655bc2  
    3434 */
    3535
    36 #include <adt/hash.h>
    3736#include <stdlib.h>
    3837#include <stdio.h>
     
    4342        ht_link_t link;
    4443
    45         size_t hash;
    4644        char *key;
    4745        char *value;
     
    5149{
    5250        param_t *param = hash_table_get_inst(item, param_t, link);
    53         return param->hash;
     51        return str_size(param->key);
    5452}
    5553
    5654static size_t param_key_hash(const void *key)
    5755{
    58         return hash_string(key);
     56        const char *key_str = key;
     57        return str_size(key_str);
    5958}
    6059
    61 static bool param_key_equal(const void *key, size_t hash, const ht_link_t *item)
     60static bool param_key_equal(const void *key, const ht_link_t *item)
    6261{
    6362        param_t *param = hash_table_get_inst(item, param_t, link);
     63        const char *key_str = key;
    6464
    65         if (param->hash != hash)
    66                 return false;
    67 
    68         const char *key_str = key;
    6965        return str_cmp(param->key, key_str) == 0;
    7066}
     
    7571        param_t *b = hash_table_get_inst(link_b, param_t, link);
    7672
    77         return a->hash == b->hash && str_cmp(a->key, b->key) == 0;
     73        return str_cmp(a->key, b->key) == 0;
    7874}
    7975
     
    120116        param->key = str_dup(key);
    121117        param->value = str_dup(value);
    122         param->hash = hash_string(key);
    123118
    124119        if ((param->key == NULL) || (param->value == NULL)) {
     
    137132const char *bench_env_param_get(bench_env_t *env, const char *key, const char *default_value)
    138133{
    139         ht_link_t *item = hash_table_find(&env->parameters, key);
     134        ht_link_t *item = hash_table_find(&env->parameters, (char *) key);
    140135
    141136        if (item == NULL) {
Note: See TracChangeset for help on using the changeset viewer.