diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-21 15:38:38 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-21 15:38:38 +0000 |
commit | 3090169c9b5077ebcd051f9081c3a0baa8ff83e4 (patch) | |
tree | b3738451ebda87adec3c8e997cdf6427de3f1414 /lib | |
parent | b867882a1c2a358bb7a46f84365c86a959d35240 (diff) | |
download | ruby-3090169c9b5077ebcd051f9081c3a0baa8ff83e4.tar.gz |
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')
-rw-r--r-- | lib/set.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/set.rb b/lib/set.rb index 009721381b..292a00adf9 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 { |