mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
b4795cdbba
commit
11c7566aa3
2 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Sun May 19 17:29:07 2013 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* lib/set.rb (Set#delete_if, Set#keep_if): Add comments.
|
||||
|
||||
Sun May 19 11:37:36 2013 Kazuki Tsujimoto <kazuki@callcc.net>
|
||||
|
||||
* ext/fiddle/extconf.rb: ignore rc version of libffi to fix build failure.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue