summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-15 18:10:16 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-15 18:10:16 +0000
commit343b2aa615b109ea6891326f45a465e90233bbeb (patch)
tree0211ed9fbf10716f6ff46c34fef46e824fc3381e /hash.c
parent62550b1d0f07389e2806540047b8ea409ec2d707 (diff)
merge revision(s) 51410: [Backport #11396]
* symbol.h (struct RSymbol): add hashval field * symbol.c (dsymbol_alloc): setup hashval field once * hash.c (rb_any_hash): return RSymbol->hashval directly * common.mk: hash.o depends on symbol.h Thanks to Bruno Escherl <bruno@escherl.net> for the bug report [ruby-core:70129] [Bug #11396] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@51589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 9a68bd7507..d7a4046a90 100644
--- a/hash.c
+++ b/hash.c
@@ -17,6 +17,7 @@
#include <errno.h>
#include "probes.h"
#include "id.h"
+#include "symbol.h"
#ifdef __APPLE__
# ifdef HAVE_CRT_EXTERNS_H
@@ -150,7 +151,7 @@ rb_any_hash(VALUE a)
hnum = rb_str_hash(a);
}
else if (BUILTIN_TYPE(a) == T_SYMBOL) {
- hnum = rb_objid_hash((st_index_t)a);
+ return RSYMBOL(a)->hashval;
}
else if (BUILTIN_TYPE(a) == T_FLOAT) {
flt: