From 3090169c9b5077ebcd051f9081c3a0baa8ff83e4 Mon Sep 17 00:00:00 2001 From: knu Date: Sat, 21 Oct 2017 15:38:38 +0000 Subject: 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 --- lib/set.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/set.rb') 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 { -- cgit v1.2.3