* string.c (single_byte_optimizable): rb_enc_mbminlen must be 1
when rb_enc_mbmaxlen is 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0831222a91
commit
132e3f54f2
2
string.c
2
string.c
@ -101,7 +101,7 @@ single_byte_optimizable(VALUE str)
|
|||||||
{
|
{
|
||||||
rb_encoding *enc = STR_ENC_GET(str);
|
rb_encoding *enc = STR_ENC_GET(str);
|
||||||
|
|
||||||
if (rb_enc_mbminlen(enc) == 1 && rb_enc_mbmaxlen(enc) == 1)
|
if (rb_enc_mbmaxlen(enc) == 1)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Conservative. It may be ENC_CODERANGE_UNKNOWN. */
|
/* Conservative. It may be ENC_CODERANGE_UNKNOWN. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user