mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
2 changed files with 7 additions and 2 deletions
|
@ -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>
|
||||
|
||||
* 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;
|
||||
|
||||
str = rb_tainted_str_new(ptr, len);
|
||||
if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT &&
|
||||
eenc == rb_usascii_encoding()) {
|
||||
if (eenc == rb_usascii_encoding() &&
|
||||
rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
|
||||
rb_enc_associate(str, rb_ascii8bit_encoding());
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue