From 2a366ffba8397c6f848d659dce76e03e1bf05d17 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 1 Jun 2020 10:36:28 +0900 Subject: Use functions that take symbols to reduce string litrals in C. --- mrbgems/mruby-complex/src/complex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mrbgems/mruby-complex/src/complex.c') diff --git a/mrbgems/mruby-complex/src/complex.c b/mrbgems/mruby-complex/src/complex.c index 0432da633..24dad4235 100644 --- a/mrbgems/mruby-complex/src/complex.c +++ b/mrbgems/mruby-complex/src/complex.c @@ -69,7 +69,7 @@ complex_ptr(mrb_state *mrb, mrb_value v) static mrb_value complex_new(mrb_state *mrb, mrb_float real, mrb_float imaginary) { - struct RClass *c = mrb_class_get(mrb, "Complex"); + struct RClass *c = mrb_class_get_id(mrb, MRB_SYM(Complex)); struct mrb_complex *p; struct RBasic *comp = complex_alloc(mrb, c, &p); p->real = real; @@ -224,7 +224,7 @@ void mrb_mruby_complex_gem_init(mrb_state *mrb) #ifdef COMPLEX_USE_ISTRUCT mrb_assert(sizeof(struct mrb_complex) < ISTRUCT_DATA_SIZE); #endif - comp = mrb_define_class(mrb, "Complex", mrb_class_get(mrb, "Numeric")); + comp = mrb_define_class(mrb, "Complex", mrb_class_get_id(mrb, MRB_SYM(Numeric))); #ifdef COMPLEX_USE_ISTRUCT MRB_SET_INSTANCE_TT(comp, MRB_TT_ISTRUCT); #else -- cgit v1.2.3