mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
1704e7a6a7
commit
faa26f5570
1 changed files with 1 additions and 1 deletions
2
string.c
2
string.c
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue