Skip to content

Commit 9f65bc6

Browse files
committed
update _type_hash.
1 parent 9bb55e2 commit 9f65bc6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cstl_types_aux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ size_t _type_hash(const char* s_typename)
143143
t_hash = t_hash * _TYPE_HASH_BKDR_SEED + (*s_typename++);
144144
}
145145

146-
return (t_hash & 0x7fffffff) % _TYPE_REGISTER_BUCKET_COUNT;
146+
return t_hash % _TYPE_REGISTER_BUCKET_COUNT;
147147
}
148148

149149
/**

test/ut/ut_cstl_types_aux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void test__type_hash__equalto_bucketcount(void** state)
5050

5151
void test__type_hash__greaterthan_bucketcount(void** state)
5252
{
53-
assert_true(_type_hash("abcabcabcabcabc") == 118);
53+
assert_true(_type_hash("abcdefghijklmnopqrstuvwxyzz") == 278);
5454
}
5555

5656
#define TEST__TYPE_REGISTER_BEGIN()\

0 commit comments

Comments
 (0)