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 /rational.c | |
parent | 7cf7e6c33226093c9c4e3078f7ced3b9b9c99b05 (diff) | |
download | ruby-c6f439a6a8df582416e756d7511aa4d9c72071a9.tar.gz |
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
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/rational.c b/rational.c index e537bd498b..48a9ab2ed2 100644 --- a/rational.c +++ b/rational.c @@ -2061,30 +2061,6 @@ rb_rational_canonicalize(VALUE x) /* * call-seq: - * int.numerator -> self - * - * Returns self. - */ -static VALUE -integer_numerator(VALUE self) -{ - return self; -} - -/* - * call-seq: - * int.denominator -> 1 - * - * Returns 1. - */ -static VALUE -integer_denominator(VALUE self) -{ - return INT2FIX(1); -} - -/* - * call-seq: * flo.numerator -> integer * * Returns the numerator. The result is machine dependent. @@ -2832,9 +2808,6 @@ Init_Rational(void) rb_define_method(rb_cNumeric, "denominator", numeric_denominator, 0); rb_define_method(rb_cNumeric, "quo", rb_numeric_quo, 1); - rb_define_method(rb_cInteger, "numerator", integer_numerator, 0); - rb_define_method(rb_cInteger, "denominator", integer_denominator, 0); - rb_define_method(rb_cFloat, "numerator", rb_float_numerator, 0); rb_define_method(rb_cFloat, "denominator", rb_float_denominator, 0); |