diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-09 02:45:03 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-09 02:45:03 +0000 |
commit | 4c0c299964b8357aec10d577e685c73f86c6eed3 (patch) | |
tree | 47a72e8e2f75f0e44ec382cae6ee0aea4cbc029c /enumerator.c | |
parent | e6358072514105ec4fbe39a308637834642fb15d (diff) |
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
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/enumerator.c b/enumerator.c index d61d79e897..98c2b47641 100644 --- a/enumerator.c +++ b/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"); |