summaryrefslogtreecommitdiff
path: root/lib/set.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-19 08:33:27 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-19 08:33:27 +0000
commit11c7566aa38222c8120c076cf328c847d62b9a85 (patch)
tree87a6bc95aa1f527a205fbd6ec17c58a40c0c26d4 /lib/set.rb
parentb4795cdbba22ace10ca91eb15b9793abea6c56e6 (diff)
* lib/set.rb (Set#delete_if, Set#keep_if): Add comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/set.rb')
-rw-r--r--lib/set.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 4f925e3..4668b4e 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -272,6 +272,8 @@ class Set
# true, and returns self.
def delete_if
block_given? or return enum_for(__method__)
+ # @hash.delete_if should be faster, but using it breaks the order
+ # of enumeration in subclasses.
select(&proc).each(&@hash.method(:delete))
self
end
@@ -280,6 +282,8 @@ class Set
# false, and returns self.
def keep_if
block_given? or return enum_for(__method__)
+ # @hash.keep_if should be faster, but using it breaks the order of
+ # enumeration in subclasses.
reject(&proc).each(&@hash.method(:delete))
self
end