From 779ae78995977305aa5aec9cb5b562dcf54c22e7 Mon Sep 17 00:00:00 2001 From: tmm1 Date: Sun, 8 Dec 2013 01:52:28 +0000 Subject: hash.c: revert r43870 and add alternative parser patch for literal keys * hash.c (hash_aset_str): revert r43870 due to performance issue [Bug #9188] [ruby-core:58730] * parse.y (assoc): convert literal string hash keys to fstrings * test/ruby/test_hash.rb (class TestHash): expand test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_hash.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 6aaba469db..4244b86b56 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -209,10 +209,11 @@ class TestHash < Test::Unit::TestCase assert_equal(256, h[z]) end - def test_ASET_string + def test_NEWHASH_fstring_key a = {"ABC" => :t} b = {"ABC" => :t} assert_same a.keys[0], b.keys[0] + assert_same "ABC".freeze, a.keys[0] end def test_EQUAL # '==' -- cgit v1.2.3