mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 03:24:00 +02:00
* include/ruby/ruby.h (rb_intern_const): tiny optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c65dc8c3b1
commit
5f9c188d97
22 changed files with 35 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue