diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-29 15:10:19 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-29 15:10:23 -0500 |
commit | f6afb04abbf46d04c718fa3506000f4fb41e2510 (patch) | |
tree | f2a22f763230e83e06d272c0853faf20e2a800f2 /src/ext/ht.h | |
parent | 5faa017b86c0ab3ec4ffc22c9ec8d6c1a67d58ea (diff) | |
download | tor-f6afb04abbf46d04c718fa3506000f4fb41e2510.tar.gz tor-f6afb04abbf46d04c718fa3506000f4fb41e2510.zip |
Use HT_BUCKET_NUM_ in more places
(patch from sysrqb)
Diffstat (limited to 'src/ext/ht.h')
-rw-r--r-- | src/ext/ht.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ext/ht.h b/src/ext/ht.h index 9b3bcaf91b..19a67a6a41 100644 --- a/src/ext/ht.h +++ b/src/ext/ht.h @@ -287,8 +287,7 @@ ht_string_hash(const char *s) HT_BUCKET_NUM_(head,field,(*elm)->field.hte_next,hashfn)); \ return &(*elm)->field.hte_next; \ } else { \ - unsigned b = (HT_ELT_HASH_(*elm, field, hashfn) \ - % head->hth_table_length)+1; \ + unsigned b = HT_BUCKET_NUM_(head,field,*elm,hashfn)+1; \ while (b < head->hth_table_length) { \ if (head->hth_table[b]) { \ HT_ASSERT_(b == \ @@ -434,7 +433,7 @@ ht_string_hash(const char *s) for (elm = head->hth_table[i]; elm; elm = elm->field.hte_next) { \ if (HT_ELT_HASH_(elm, field, hashfn) != hashfn(elm)) \ return 1000 + i; \ - if ((HT_ELT_HASH_(elm, field, hashfn) % head->hth_table_length) != i) \ + if (HT_BUCKET_NUM_(head,field,elm,hashfn) != i) \ return 10000 + i; \ ++n; \ } \ |