| 147 |
if (p_item->key == key) |
if (p_item->key == key) |
| 148 |
{ |
{ |
| 149 |
p_item->value = value; |
p_item->value = value; |
| 150 |
return 0; |
return 1; |
| 151 |
} |
} |
| 152 |
p_item = p_item->p_next; |
p_item = p_item->p_next; |
| 153 |
} |
} |
| 190 |
if (p_item->key == key) |
if (p_item->key == key) |
| 191 |
{ |
{ |
| 192 |
p_item->value += value_inc; |
p_item->value += value_inc; |
| 193 |
return 0; |
return 1; |
| 194 |
} |
} |
| 195 |
p_item = p_item->p_next; |
p_item = p_item->p_next; |
| 196 |
} |
} |
| 197 |
|
|
|
p_item = (HASH_ITEM *)memory_pool_alloc(p_dict->p_item_pool); |
|
|
if (p_item == NULL) |
|
|
{ |
|
|
log_error("memory_pool_alloc(HASH_ITEM) error\n"); |
|
|
return -1; |
|
|
} |
|
|
|
|
|
p_item->key = key; |
|
|
p_item->value = value_inc; |
|
|
p_item->p_next = p_dict->buckets[bucket_index][item_index_in_bucket]; |
|
|
p_dict->buckets[bucket_index][item_index_in_bucket] = p_item; |
|
|
|
|
|
(p_dict->item_count)++; |
|
|
|
|
| 198 |
return 0; |
return 0; |
| 199 |
} |
} |
| 200 |
|
|