From e49a472aad43e92e7b71ed38d6c7c091645a90f6 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 7 Nov 2016 00:45:00 +0000 Subject: Introduce table improvement by Vladimir Makarov . [Feature #12142] See header of st.c for improvment details. You can see all of code history here: This improvement is discussed at with many people, especially with Yura Sokolov. * st.c: improve st_table. * include/ruby/st.h: ditto. * internal.h, numeric.c, hash.c (rb_dbl_long_hash): extract a function. * ext/-test-/st/foreach/foreach.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 3620f1f3b8..6ab3593cfc 100644 --- a/numeric.c +++ b/numeric.c @@ -1421,12 +1421,7 @@ flo_hash(VALUE num) VALUE rb_dbl_hash(double d) { - st_index_t hash; - - /* normalize -0.0 to 0.0 */ - if (d == 0.0) d = 0.0; - hash = rb_memhash(&d, sizeof(d)); - return ST2FIX(hash); + return LONG2FIX(rb_dbl_long_hash (d)); } VALUE -- cgit v1.2.3