Replace find_all + each with grep
This commit is contained in:
parent
fe3e802c50
commit
177eee419a
@ -5,8 +5,7 @@ class ComparableSet < Set
|
|||||||
# smileys only
|
# smileys only
|
||||||
return super new unless new.respond_to? :>
|
return super new unless new.respond_to? :>
|
||||||
|
|
||||||
objs = find_all { |o| o.class == new.class }
|
grep(new.class) do |o|
|
||||||
objs.each do |o|
|
|
||||||
return self if o > new
|
return self if o > new
|
||||||
delete o
|
delete o
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user