File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11benchmark :
22 - ' Time.now'
33 - ' Time.now(in: "+09:00")'
4+ - ' Time.now.year'
Original file line number Diff line number Diff line change @@ -981,7 +981,6 @@ zone_str(const char *zone)
981981{
982982 const char * p ;
983983 int ascii_only = 1 ;
984- VALUE str ;
985984 size_t len ;
986985
987986 if (zone == NULL ) {
@@ -997,18 +996,18 @@ zone_str(const char *zone)
997996 }
998997 len = p - zone ;
999998 if (ascii_only ) {
1000- str = rb_usascii_str_new (zone , len );
999+ return rb_enc_interned_str (zone , len , rb_usascii_encoding () );
10011000 }
10021001 else {
10031002#ifdef _WIN32
1004- str = rb_utf8_str_new (zone , len );
1003+ VALUE str = rb_utf8_str_new (zone , len );
10051004 /* until we move to UTF-8 on Windows completely */
10061005 str = rb_str_export_locale (str );
1006+ return rb_fstring (str );
10071007#else
1008- str = rb_enc_str_new (zone , len , rb_locale_encoding ());
1008+ return rb_enc_interned_str (zone , len , rb_locale_encoding ());
10091009#endif
10101010 }
1011- return rb_fstring (str );
10121011}
10131012
10141013static void
You can’t perform that action at this time.
0 commit comments