summaryrefslogtreecommitdiff
path: root/lib/set.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 15:38:38 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 15:38:38 +0000
commit3090169c9b5077ebcd051f9081c3a0baa8ff83e4 (patch)
treeb3738451ebda87adec3c8e997cdf6427de3f1414 /lib/set.rb
parentb867882a1c2a358bb7a46f84365c86a959d35240 (diff)
Allow a SortedSet to be frozen and still functional [Bug #12091]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/set.rb')
-rw-r--r--lib/set.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 0097213..292a00a 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -723,6 +723,11 @@ class SortedSet < Set
(@keys = @hash.keys).sort! unless @keys
@keys
end
+
+ def freeze
+ to_a
+ super
+ end
END
end
module_eval {