1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/intern.h (rb_str_new2, rb_tainted_str_new2,

rb_usascii_str_new2): use with-length versions with strlen to
  optimize strlen, if optimized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-06-27 04:29:29 +00:00
parent 2983df49d5
commit f1d4745627
2 changed files with 3 additions and 3 deletions

View file

@ -1,8 +1,8 @@
Fri Jun 27 13:18:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri Jun 27 13:29:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/intern.h (rb_str_new2, rb_tainted_str_new2, * include/ruby/intern.h (rb_str_new2, rb_tainted_str_new2,
rb_usascii_str_new2): use with-length versions with strlen to rb_usascii_str_new2): use with-length versions with strlen to
optimize strlen. optimize strlen, if optimized.
Fri Jun 27 12:28:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri Jun 27 12:28:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>

View file

@ -535,7 +535,7 @@ VALUE rb_str_buf_new2(const char*);
VALUE rb_str_tmp_new(long); VALUE rb_str_tmp_new(long);
VALUE rb_usascii_str_new(const char*, long); VALUE rb_usascii_str_new(const char*, long);
VALUE rb_usascii_str_new2(const char*); VALUE rb_usascii_str_new2(const char*);
#ifdef __GNUC__ #if defined __GNUC__ && defined __OPTIMIZE__ && __OPTIMIZE__
#define rb_str_new2(str) ({const char *_s = (str); rb_str_new(_s, strlen(_s));}) #define rb_str_new2(str) ({const char *_s = (str); rb_str_new(_s, strlen(_s));})
#define rb_tainted_str_new2(str) ({const char *_s = (str); rb_tainted_str_new(_s, strlen(_s));}) #define rb_tainted_str_new2(str) ({const char *_s = (str); rb_tainted_str_new(_s, strlen(_s));})
#define rb_usascii_str_new2(str) ({const char *_s = (str); rb_usascii_str_new(_s, strlen(_s));}) #define rb_usascii_str_new2(str) ({const char *_s = (str); rb_usascii_str_new(_s, strlen(_s));})