Skip to content

Commit

Permalink
Make Enumerable#each_cons and #each_slice return the receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmfernandes committed Jan 13, 2023
1 parent e8875c4 commit 9ba6ae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/ruby/truffleruby/core/enumerable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ def each_cons(num)
array.shift if array.size > n
yield array.dup if array.size == n
end
nil
self
end

def each_slice(slice_size)
Expand All @@ -668,7 +668,7 @@ def each_slice(slice_size)
end

yield a unless a.empty?
nil
self
end

def find(ifnone=nil)
Expand Down

0 comments on commit 9ba6ae2

Please sign in to comment.