From ed0ffcdc80c41b3b1adacc7135ddf7880380c6a3 Mon Sep 17 00:00:00 2001 From: Mari Imaizumi Date: Sun, 31 Aug 2025 23:02:23 +0900 Subject: [PATCH] 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 --- template/unicode_norm_gen.tmpl | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/template/unicode_norm_gen.tmpl b/template/unicode_norm_gen.tmpl index 17505f100e9f8e..773a727cec62af 100644 --- a/template/unicode_norm_gen.tmpl +++ b/template/unicode_norm_gen.tmpl @@ -22,23 +22,6 @@ class Integer end end -module Enumerable - unless method_defined?(:each_slice) - def each_slice(n) - ary = [] - each do |i| - ary << i - if ary.size >= n - yield ary - ary = [] - end - end - yield ary unless ary.empty? - self - end - end -end - class Array def to_UTF8() collect {|c| c.to_UTF8}.join('') end