Skip to content

Commit 2ed4862

Browse files
committed
Remove unnecessary union
1 parent 1e436f2 commit 2ed4862

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

vm.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,9 @@ vm_cref_new0(VALUE klass, rb_method_visibility_t visi, int module_func, rb_cref_
233233
int omod_shared = FALSE;
234234

235235
/* scope */
236-
union {
237-
rb_scope_visibility_t visi;
238-
VALUE value;
239-
} scope_visi;
240-
241-
scope_visi.visi.method_visi = visi;
242-
scope_visi.visi.module_func = module_func;
236+
rb_scope_visibility_t scope_visi;
237+
scope_visi.method_visi = visi;
238+
scope_visi.module_func = module_func;
243239

244240
/* refinements */
245241
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_
256252
rb_cref_t *cref = IMEMO_NEW(rb_cref_t, imemo_cref, refinements);
257253
cref->klass_or_self = klass;
258254
cref->next = use_prev_prev ? CREF_NEXT(prev_cref) : prev_cref;
259-
*((rb_scope_visibility_t *)&cref->scope_visi) = scope_visi.visi;
255+
*((rb_scope_visibility_t *)&cref->scope_visi) = scope_visi;
260256

261257
if (pushed_by_eval) CREF_PUSHED_BY_EVAL_SET(cref);
262258
if (omod_shared) CREF_OMOD_SHARED_SET(cref);

0 commit comments

Comments
 (0)