diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-06 12:50:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-06 12:50:10 +0000 |
commit | f7812f6af2b24cee99b14f7c6137d4a7537a137e (patch) | |
tree | 56128e91bce0480f7c0ad4faa25376b64fee3857 /string.c | |
parent | 29098c036b29189c63dd29ef049c390ed580739c (diff) | |
download | ruby-f7812f6af2b24cee99b14f7c6137d4a7537a137e.tar.gz |
string.c: optimize enumerate_grapheme_clusters
* string.c (rb_str_enumerate_grapheme_clusters): optimize when
single byte only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -8027,7 +8027,7 @@ rb_str_enumerate_grapheme_clusters(VALUE str, VALUE ary) int unicode_p = rb_enc_unicode_p(enc); const char *ptr, *end; - if (!unicode_p) { + if (!unicode_p || single_byte_optimizable(str)) { return rb_str_enumerate_chars(str, ary); } |