From 6e0f5b8407b625a3039d93f48b56aac5695aa48e Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 22 Mar 2018 07:58:37 +0000 Subject: [PATCH] Revert "each_grapheme_cluster shouldn't return size [Bug #14363]" This reverts commit r62887. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 +- test/ruby/test_string.rb | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/string.c b/string.c index 4e62f5971e..0ab2012c89 100644 --- a/string.c +++ b/string.c @@ -8426,7 +8426,7 @@ rb_str_enumerate_grapheme_clusters(VALUE str, VALUE ary) static VALUE rb_str_each_grapheme_cluster(VALUE str) { - RETURN_ENUMERATOR(str, 0, 0); + RETURN_SIZED_ENUMERATOR(str, 0, 0, rb_str_each_char_size); return rb_str_enumerate_grapheme_clusters(str, 0); } diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 31b7abe31c..f71dfc7fee 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -989,9 +989,6 @@ CODE assert_equal ["a", "b", "c"], "abc".b.each_grapheme_cluster.to_a s = ("x"+"\u{10ABCD}"*250000) assert_empty(s.each_grapheme_cluster {s.clear}) - - assert_nil "\u{20 200d}".each_grapheme_cluster.size - assert_nil "\u{a 308}".each_grapheme_cluster.size end def test_grapheme_clusters