summaryrefslogtreecommitdiffstats
path: root/include/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-27 04:29:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-27 04:29:29 +0000
commitd78fcb9272cd748b57241f7e2238dbe9a005fb44 (patch)
tree8f1ce85f2c2f64875f2ce8ebe77fed3f86feedc7 /include/ruby
parentb12b8bf584952354cf506d8561d55a71b26d5bcc (diff)
downloadruby-d78fcb9272cd748b57241f7e2238dbe9a005fb44.tar.gz
ruby-d78fcb9272cd748b57241f7e2238dbe9a005fb44.tar.xz
ruby-d78fcb9272cd748b57241f7e2238dbe9a005fb44.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@17599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/intern.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index f6a72b44d..fdd388792 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -535,7 +535,7 @@ VALUE rb_str_buf_new2(const char*);
VALUE rb_str_tmp_new(long);
VALUE rb_usascii_str_new(const char*, long);
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_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));})