diff options
author | S.H <gamelinks007@gmail.com> | 2022-10-28 01:13:16 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-27 09:13:16 -0700 |
commit | c6f439a6a8df582416e756d7511aa4d9c72071a9 (patch) | |
tree | 1c9d36b4ace554f42160800e8343a88a180b85fd /complex.c | |
parent | 7cf7e6c33226093c9c4e3078f7ced3b9b9c99b05 (diff) |
Improve performance some `Integer` and `Float` methods [Feature #19085] (#6638)
* Improve some Integer and Float methods
* Using alias and Remove unnecessary code
* Remove commentout code
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'complex.c')
-rw-r--r-- | complex.c | 43 |
1 files changed, 0 insertions, 43 deletions
@@ -2161,31 +2161,6 @@ nucomp_s_convert(int argc, VALUE *argv, VALUE klass) /* * call-seq: - * num.real -> self - * - * Returns self. - */ -static VALUE -numeric_real(VALUE self) -{ - return self; -} - -/* - * call-seq: - * num.imag -> 0 - * num.imaginary -> 0 - * - * Returns zero. - */ -static VALUE -numeric_imag(VALUE self) -{ - return INT2FIX(0); -} - -/* - * call-seq: * num.abs2 -> real * * Returns square of self. @@ -2257,19 +2232,6 @@ numeric_polar(VALUE self) /* * call-seq: - * num.conj -> self - * num.conjugate -> self - * - * Returns self. - */ -static VALUE -numeric_conj(VALUE self) -{ - return self; -} - -/* - * call-seq: * flo.arg -> 0 or float * flo.angle -> 0 or float * flo.phase -> 0 or float @@ -2433,9 +2395,6 @@ Init_Complex(void) rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1); - rb_define_method(rb_cNumeric, "real", numeric_real, 0); - rb_define_method(rb_cNumeric, "imaginary", numeric_imag, 0); - rb_define_method(rb_cNumeric, "imag", numeric_imag, 0); rb_define_method(rb_cNumeric, "abs2", numeric_abs2, 0); rb_define_method(rb_cNumeric, "arg", numeric_arg, 0); rb_define_method(rb_cNumeric, "angle", numeric_arg, 0); @@ -2443,8 +2402,6 @@ Init_Complex(void) rb_define_method(rb_cNumeric, "rectangular", numeric_rect, 0); rb_define_method(rb_cNumeric, "rect", numeric_rect, 0); rb_define_method(rb_cNumeric, "polar", numeric_polar, 0); - rb_define_method(rb_cNumeric, "conjugate", numeric_conj, 0); - rb_define_method(rb_cNumeric, "conj", numeric_conj, 0); rb_define_method(rb_cFloat, "arg", float_arg, 0); rb_define_method(rb_cFloat, "angle", float_arg, 0); |