Skip to content

Commit

Permalink
update _type_hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
activesys committed Dec 27, 2013
1 parent 9bb55e2 commit 9f65bc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cstl_types_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ size_t _type_hash(const char* s_typename)
t_hash = t_hash * _TYPE_HASH_BKDR_SEED + (*s_typename++);
}

return (t_hash & 0x7fffffff) % _TYPE_REGISTER_BUCKET_COUNT;
return t_hash % _TYPE_REGISTER_BUCKET_COUNT;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/ut/ut_cstl_types_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void test__type_hash__equalto_bucketcount(void** state)

void test__type_hash__greaterthan_bucketcount(void** state)
{
assert_true(_type_hash("abcabcabcabcabc") == 118);
assert_true(_type_hash("abcdefghijklmnopqrstuvwxyzz") == 278);
}

#define TEST__TYPE_REGISTER_BEGIN()\
Expand Down

0 comments on commit 9f65bc6

Please sign in to comment.