diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-07 00:45:00 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-07 00:45:00 +0000 |
commit | 75775157ea68efdd0b71345a37a6930e5bf1d2ef (patch) | |
tree | 311920522c27ab515ddfda5d1f45d1d3f68f142a /numeric.c | |
parent | 2bb96b87a752ba186bd285e43239119c6c2f2678 (diff) | |
download | ruby-75775157ea68efdd0b71345a37a6930e5bf1d2ef.tar.gz |
Introduce table improvement by Vladimir Makarov <vmakarov@redhat.com>.
[Feature #12142]
See header of st.c for improvment details.
You can see all of code history here:
<https://github.com/vnmakarov/ruby/tree/hash_tables_with_open_addressing>
This improvement is discussed at
<https://bugs.ruby-lang.org/issues/12142>
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
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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 |