зеркало из https://github.com/github/ruby.git
Get rid of magic numbers
This commit is contained in:
Родитель
2b4b513ef0
Коммит
2c6876f811
|
@ -629,20 +629,22 @@ count_imemo_objects(int argc, VALUE *argv, VALUE self)
|
||||||
VALUE hash = setup_hash(argc, argv);
|
VALUE hash = setup_hash(argc, argv);
|
||||||
|
|
||||||
if (imemo_type_ids[0] == 0) {
|
if (imemo_type_ids[0] == 0) {
|
||||||
imemo_type_ids[0] = rb_intern("imemo_env");
|
#define INIT_IMEMO_TYPE_ID(n) (imemo_type_ids[n] = rb_intern(#n))
|
||||||
imemo_type_ids[1] = rb_intern("imemo_cref");
|
INIT_IMEMO_TYPE_ID(imemo_env);
|
||||||
imemo_type_ids[2] = rb_intern("imemo_svar");
|
INIT_IMEMO_TYPE_ID(imemo_cref);
|
||||||
imemo_type_ids[3] = rb_intern("imemo_throw_data");
|
INIT_IMEMO_TYPE_ID(imemo_svar);
|
||||||
imemo_type_ids[4] = rb_intern("imemo_ifunc");
|
INIT_IMEMO_TYPE_ID(imemo_throw_data);
|
||||||
imemo_type_ids[5] = rb_intern("imemo_memo");
|
INIT_IMEMO_TYPE_ID(imemo_ifunc);
|
||||||
imemo_type_ids[6] = rb_intern("imemo_ment");
|
INIT_IMEMO_TYPE_ID(imemo_memo);
|
||||||
imemo_type_ids[7] = rb_intern("imemo_iseq");
|
INIT_IMEMO_TYPE_ID(imemo_ment);
|
||||||
imemo_type_ids[8] = rb_intern("imemo_tmpbuf");
|
INIT_IMEMO_TYPE_ID(imemo_iseq);
|
||||||
imemo_type_ids[9] = rb_intern("imemo_ast");
|
INIT_IMEMO_TYPE_ID(imemo_tmpbuf);
|
||||||
imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
|
INIT_IMEMO_TYPE_ID(imemo_ast);
|
||||||
imemo_type_ids[11] = rb_intern("imemo_callinfo");
|
INIT_IMEMO_TYPE_ID(imemo_parser_strterm);
|
||||||
imemo_type_ids[12] = rb_intern("imemo_callcache");
|
INIT_IMEMO_TYPE_ID(imemo_callinfo);
|
||||||
imemo_type_ids[13] = rb_intern("imemo_constcache");
|
INIT_IMEMO_TYPE_ID(imemo_callcache);
|
||||||
|
INIT_IMEMO_TYPE_ID(imemo_constcache);
|
||||||
|
#undef INIT_IMEMO_TYPE_ID
|
||||||
}
|
}
|
||||||
|
|
||||||
each_object_with_flags(count_imemo_objects_i, (void *)hash);
|
each_object_with_flags(count_imemo_objects_i, (void *)hash);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче