summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-24 11:53:19 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-24 11:53:19 +0000
commit7850586af435f44ff97c93decc97995bbdf6bad4 (patch)
tree12c290c32f7acee2a3698e906ba40c24dcb72816 /string.c
parentf33adbc11e0fa0a2bd73b96ee3a3529481eb111d (diff)
Don't use single byte optimization on grapheme clusters
Unicode Text Segmentation considers CRLF as a character. [Bug #15337] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index d7ef9cc9bc..26d03d1835 100644
--- a/string.c
+++ b/string.c
@@ -8459,7 +8459,7 @@ rb_str_each_grapheme_cluster_size(VALUE str, VALUE args, VALUE eobj)
rb_encoding *enc = rb_enc_from_index(ENCODING_GET(str));
const char *ptr, *end;
- if (!rb_enc_unicode_p(enc) || single_byte_optimizable(str)) {
+ if (!rb_enc_unicode_p(enc)) {
return rb_str_length(str);
}
@@ -8487,7 +8487,7 @@ rb_str_enumerate_grapheme_clusters(VALUE str, VALUE ary)
rb_encoding *enc = rb_enc_from_index(ENCODING_GET(str));
const char *ptr, *end;
- if (!rb_enc_unicode_p(enc) || single_byte_optimizable(str)) {
+ if (!rb_enc_unicode_p(enc)) {
return rb_str_enumerate_chars(str, ary);
}