* string.c (rb_external_str_new_with_enc): change evaluatioin order
for speed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d37857e2b
commit
28eb7acf2c
@ -1,3 +1,8 @@
|
|||||||
|
Sat Feb 14 07:23:52 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_external_str_new_with_enc): change evaluatioin order
|
||||||
|
for speed.
|
||||||
|
|
||||||
Sat Feb 14 02:20:04 2009 Tanaka Akira <akr@fsij.org>
|
Sat Feb 14 02:20:04 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/sockport.h (SET_SA_LEN): cast to void for supressing a
|
* ext/socket/sockport.h (SET_SA_LEN): cast to void for supressing a
|
||||||
|
4
string.c
4
string.c
@ -538,8 +538,8 @@ rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *eenc)
|
|||||||
VALUE str;
|
VALUE str;
|
||||||
|
|
||||||
str = rb_tainted_str_new(ptr, len);
|
str = rb_tainted_str_new(ptr, len);
|
||||||
if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT &&
|
if (eenc == rb_usascii_encoding() &&
|
||||||
eenc == rb_usascii_encoding()) {
|
rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
|
||||||
rb_enc_associate(str, rb_ascii8bit_encoding());
|
rb_enc_associate(str, rb_ascii8bit_encoding());
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user