зеркало из https://github.com/github/ruby.git
* 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:
Родитель
b4795cdbba
Коммит
11c7566aa3
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче