зеркало из https://github.com/github/ruby.git
string.c: negative hash
* string.c (rb_str_hash_m): hash values may be negative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7a44019031
Коммит
63d77c2a1b
|
@ -1,3 +1,7 @@
|
|||
Sun Oct 2 07:51:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_hash_m): hash values may be negative.
|
||||
|
||||
Sun Oct 2 02:04:12 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_hash_m): st_index_t is not guaranteed as the same
|
||||
|
|
4
string.c
4
string.c
|
@ -2964,9 +2964,9 @@ rb_str_hash_m(VALUE str)
|
|||
{
|
||||
st_index_t hval = rb_str_hash(str);
|
||||
#if SIZEOF_LONG == SIZEOF_VOIDP
|
||||
return ULONG2NUM(hval);
|
||||
return LONG2FIX((long)hval);
|
||||
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
||||
return ULL2NUM(hval);
|
||||
return LL2NUM((LONG_LONG)hval);
|
||||
#else
|
||||
# error unsupported platform
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче