Advertisement
Guest User

Untitled

a guest
May 29th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. ValueType* atMap (struct hashMap * ht, KeyType k)
  2. {
  3. int idx = stringHash2(k) % ht->tableSize;
  4. if (idx < 0){
  5. idx += ht->tableSize;
  6. }
  7. struct hashLink* current = ht->table[idx];
  8. while(current){
  9. if(strcmp(current->key, k)==0){
  10. ValueType* isVal = &(current->value);
  11. return isVal;
  12. }
  13. current=current->next;
  14. }
  15. return NULL;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement