mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Remove unnecessary union
This commit is contained in:
parent
1e436f2274
commit
2ed4862690
1 changed files with 4 additions and 8 deletions
12
vm.c
12
vm.c
|
@ -233,13 +233,9 @@ vm_cref_new0(VALUE klass, rb_method_visibility_t visi, int module_func, rb_cref_
|
|||
int omod_shared = FALSE;
|
||||
|
||||
/* scope */
|
||||
union {
|
||||
rb_scope_visibility_t visi;
|
||||
VALUE value;
|
||||
} scope_visi;
|
||||
|
||||
scope_visi.visi.method_visi = visi;
|
||||
scope_visi.visi.module_func = module_func;
|
||||
rb_scope_visibility_t scope_visi;
|
||||
scope_visi.method_visi = visi;
|
||||
scope_visi.module_func = module_func;
|
||||
|
||||
/* refinements */
|
||||
if (prev_cref != NULL && prev_cref != (void *)1 /* TODO: why CREF_NEXT(cref) is 1? */) {
|
||||
|
@ -256,7 +252,7 @@ vm_cref_new0(VALUE klass, rb_method_visibility_t visi, int module_func, rb_cref_
|
|||
rb_cref_t *cref = IMEMO_NEW(rb_cref_t, imemo_cref, refinements);
|
||||
cref->klass_or_self = klass;
|
||||
cref->next = use_prev_prev ? CREF_NEXT(prev_cref) : prev_cref;
|
||||
*((rb_scope_visibility_t *)&cref->scope_visi) = scope_visi.visi;
|
||||
*((rb_scope_visibility_t *)&cref->scope_visi) = scope_visi;
|
||||
|
||||
if (pushed_by_eval) CREF_PUSHED_BY_EVAL_SET(cref);
|
||||
if (omod_shared) CREF_OMOD_SHARED_SET(cref);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue