diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-29 05:54:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-29 05:54:21 +0000 |
commit | 78032eeab16d5058cbd7bb27bc840e95ad95ca84 (patch) | |
tree | 78fd985983a013d2004565c739bee3cf52cd2f1d /string.c | |
parent | 5d7d98c1ad6567c42e1d5f2c79330c8a206dd9d0 (diff) | |
download | ruby-78032eeab16d5058cbd7bb27bc840e95ad95ca84.tar.gz |
hash.c: fix symbol hash
* hash.c (rb_sym_hash): return same value as rb_any_hash() of
Symbol. [Bug #9381]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -9149,6 +9149,8 @@ rb_to_symbol(VALUE name) return rb_str_intern(name); } +VALUE rb_sym_hash(VALUE); + /* * A <code>String</code> object holds and manipulates an arbitrary sequence of * bytes, typically representing characters. String objects may be created @@ -9311,6 +9313,7 @@ Init_String(void) rb_undef_method(CLASS_OF(rb_cSymbol), "new"); rb_define_singleton_method(rb_cSymbol, "all_symbols", rb_sym_all_symbols, 0); /* in symbol.c */ + rb_define_method(rb_cSymbol, "hash", rb_sym_hash, 0); /* in hash.c */ rb_define_method(rb_cSymbol, "==", sym_equal, 1); rb_define_method(rb_cSymbol, "===", sym_equal, 1); rb_define_method(rb_cSymbol, "inspect", sym_inspect, 0); |