diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-16 00:20:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-16 00:20:31 +0000 |
commit | 0127e67a38f0103dffdaedef5d785920861f25e8 (patch) | |
tree | 2fc7030b51f956700741175f7ed5030e6d827d08 /include | |
parent | 3a78bb3062f83fab58d16d035dfa2030eb21bccf (diff) | |
download | ruby-0127e67a38f0103dffdaedef5d785920861f25e8.tar.gz ruby-0127e67a38f0103dffdaedef5d785920861f25e8.tar.xz ruby-0127e67a38f0103dffdaedef5d785920861f25e8.zip |
* include/ruby/ruby.h (rb_intern_const): tiny optimization.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/ruby.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 57610a5bd..a472ea9b2 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -830,6 +830,12 @@ VALUE rb_id2str(ID); (__builtin_constant_p(str) ? \ __extension__ (CONST_ID_CACHE(/**/, str)) : \ rb_intern(str)) +#define rb_intern_const(str) \ + (__builtin_constant_p(str) ? \ + __extension__ (rb_intern2(str, strlen(str))) : \ + (rb_intern)(str)) +#else +#define rb_intern_const(str) rb_intern2(str, strlen(str)) #endif const char *rb_class2name(VALUE); |