diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-01 10:36:28 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:20:59 +0900 |
| commit | 2a366ffba8397c6f848d659dce76e03e1bf05d17 (patch) | |
| tree | ab3d1e81ebf3659e3f5776729c8ebe1b7cbbee86 /mrbgems/mruby-complex/src | |
| parent | 8864c30d161e627438b86a986c19c048eb31bcb4 (diff) | |
| download | mruby-2a366ffba8397c6f848d659dce76e03e1bf05d17.tar.gz mruby-2a366ffba8397c6f848d659dce76e03e1bf05d17.zip | |
Use functions that take symbols to reduce string litrals in C.
Diffstat (limited to 'mrbgems/mruby-complex/src')
| -rw-r--r-- | mrbgems/mruby-complex/src/complex.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
