Skip to content

Commit ed0ffcd

Browse files
committed
Remove unnecessary Enumerable#each_slice
This method has been a built-in feature since Ruby 1.8.7, so this fallback implementation is no longer needed. Ref: https://docs.ruby-lang.org/en/3.4/NEWS/NEWS-1_8_7.html
1 parent 266393d commit ed0ffcd

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

template/unicode_norm_gen.tmpl

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,6 @@ class Integer
2222
end
2323
end
2424

25-
module Enumerable
26-
unless method_defined?(:each_slice)
27-
def each_slice(n)
28-
ary = []
29-
each do |i|
30-
ary << i
31-
if ary.size >= n
32-
yield ary
33-
ary = []
34-
end
35-
end
36-
yield ary unless ary.empty?
37-
self
38-
end
39-
end
40-
end
41-
4225
class Array
4326
def to_UTF8() collect {|c| c.to_UTF8}.join('') end
4427

0 commit comments

Comments
 (0)