diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-04 16:25:01 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-04 16:25:01 +0000 |
commit | 1cf97f54981f1bef0371ee15d6972f98ee3ff994 (patch) | |
tree | 3b8cdc92251f10fede07a7e70746ebf181655672 /hash.c | |
parent | 815c00f74197ff82e92d09b74673fb642a4a5032 (diff) | |
download | ruby-1cf97f54981f1bef0371ee15d6972f98ee3ff994.tar.gz |
* internal.h (ST2FIX): new macro to convert st_index_t to Fixnum.
a hash value of Object might be Bignum, but it causes many troubles
expecially the Object is used as a key of a hash. so I've gave up
to do so.
* array.c (rb_ary_hash): use above macro.
* bignum.c (rb_big_hash): ditto.
* hash.c (rb_obj_hash, rb_hash_hash): ditto.
* numeric.c (rb_dbl_hash): ditto.
* proc.c (proc_hash): ditto.
* re.c (rb_reg_hash, match_hash): ditto.
* string.c (rb_str_hash_m): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -239,7 +239,7 @@ VALUE rb_obj_hash(VALUE obj) { st_index_t hnum = any_hash(obj, objid_hash); - return LONG2FIX(hnum); + return ST2FIX(hnum); } int @@ -2277,7 +2277,7 @@ rb_hash_hash(VALUE hash) rb_hash_foreach(hash, hash_i, (VALUE)&hval); } hval = rb_hash_end(hval); - return INT2FIX(hval); + return ST2FIX(hval); } static int |