mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
use predefined ids in a few more places
Saves a little space on x86: text data bss dec hex filename 3684110 11968 34240 3730318 38eb8e ruby.before 3684086 11968 34240 3730294 38eb76 ruby.after * enumerator.c: include id.h, define aliases (Init_Enumeerator): remove unnecessary rb_intern calls * gc.c (should_be_callable): use idCall * vm.c (Init_VM): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e635807251
commit
4c0c299964
3 changed files with 11 additions and 9 deletions
16
enumerator.c
16
enumerator.c
|
@ -13,6 +13,7 @@
|
|||
************************************************/
|
||||
|
||||
#include "internal.h"
|
||||
#include "id.h"
|
||||
|
||||
/*
|
||||
* Document-class: Enumerator
|
||||
|
@ -102,10 +103,16 @@
|
|||
*/
|
||||
VALUE rb_cEnumerator;
|
||||
VALUE rb_cLazy;
|
||||
static ID id_rewind, id_each, id_new, id_initialize, id_yield, id_call, id_size, id_to_enum;
|
||||
static ID id_eqq, id_next, id_result, id_lazy, id_receiver, id_arguments, id_memo, id_method, id_force;
|
||||
static ID id_rewind, id_new, id_yield, id_to_enum;
|
||||
static ID id_next, id_result, id_lazy, id_receiver, id_arguments, id_memo, id_method, id_force;
|
||||
static VALUE sym_each, sym_cycle;
|
||||
|
||||
#define id_call idCall
|
||||
#define id_each idEach
|
||||
#define id_eqq idEqq
|
||||
#define id_initialize idInitialize
|
||||
#define id_size idSize
|
||||
|
||||
VALUE rb_eStopIteration;
|
||||
|
||||
struct enumerator {
|
||||
|
@ -2414,16 +2421,11 @@ void
|
|||
Init_Enumerator(void)
|
||||
{
|
||||
id_rewind = rb_intern("rewind");
|
||||
id_each = rb_intern("each");
|
||||
id_call = rb_intern("call");
|
||||
id_size = rb_intern("size");
|
||||
id_yield = rb_intern("yield");
|
||||
id_new = rb_intern("new");
|
||||
id_initialize = rb_intern("initialize");
|
||||
id_next = rb_intern("next");
|
||||
id_result = rb_intern("result");
|
||||
id_lazy = rb_intern("lazy");
|
||||
id_eqq = rb_intern("===");
|
||||
id_receiver = rb_intern("receiver");
|
||||
id_arguments = rb_intern("arguments");
|
||||
id_memo = rb_intern("memo");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue