mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Use HT_BUCKET_NUM_ in more places
(patch from sysrqb)
This commit is contained in:
parent
5faa017b86
commit
f6afb04abb
1 changed files with 2 additions and 3 deletions
|
@ -287,8 +287,7 @@ ht_string_hash(const char *s)
|
||||||
HT_BUCKET_NUM_(head,field,(*elm)->field.hte_next,hashfn)); \
|
HT_BUCKET_NUM_(head,field,(*elm)->field.hte_next,hashfn)); \
|
||||||
return &(*elm)->field.hte_next; \
|
return &(*elm)->field.hte_next; \
|
||||||
} else { \
|
} else { \
|
||||||
unsigned b = (HT_ELT_HASH_(*elm, field, hashfn) \
|
unsigned b = HT_BUCKET_NUM_(head,field,*elm,hashfn)+1; \
|
||||||
% head->hth_table_length)+1; \
|
|
||||||
while (b < head->hth_table_length) { \
|
while (b < head->hth_table_length) { \
|
||||||
if (head->hth_table[b]) { \
|
if (head->hth_table[b]) { \
|
||||||
HT_ASSERT_(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) { \
|
for (elm = head->hth_table[i]; elm; elm = elm->field.hte_next) { \
|
||||||
if (HT_ELT_HASH_(elm, field, hashfn) != hashfn(elm)) \
|
if (HT_ELT_HASH_(elm, field, hashfn) != hashfn(elm)) \
|
||||||
return 1000 + i; \
|
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; \
|
return 10000 + i; \
|
||||||
++n; \
|
++n; \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Add table
Reference in a new issue