summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/object.c b/object.c
index f0c20ed7a2..887d3b560e 100644
--- a/object.c
+++ b/object.c
@@ -1347,37 +1347,6 @@ rb_obj_frozen_p(VALUE obj)
/*
* call-seq:
- * nil.to_i -> 0
- *
- * Always returns zero.
- *
- * nil.to_i #=> 0
- */
-
-
-static VALUE
-nil_to_i(VALUE obj)
-{
- return INT2FIX(0);
-}
-
-/*
- * call-seq:
- * nil.to_f -> 0.0
- *
- * Always returns zero.
- *
- * nil.to_f #=> 0.0
- */
-
-static VALUE
-nil_to_f(VALUE obj)
-{
- return DBL2NUM(0.0);
-}
-
-/*
- * call-seq:
* nil.to_s -> ""
*
* Always returns the empty string.
@@ -4871,8 +4840,6 @@ InitVM_Object(void)
rb_cNilClass = rb_define_class("NilClass", rb_cObject);
rb_cNilClass_to_s = rb_fstring_enc_lit("", rb_usascii_encoding());
rb_gc_register_mark_object(rb_cNilClass_to_s);
- rb_define_method(rb_cNilClass, "to_i", nil_to_i, 0);
- rb_define_method(rb_cNilClass, "to_f", nil_to_f, 0);
rb_define_method(rb_cNilClass, "to_s", nil_to_s, 0);
rb_define_method(rb_cNilClass, "to_a", nil_to_a, 0);
rb_define_method(rb_cNilClass, "to_h", nil_to_h, 0);
@@ -4975,6 +4942,7 @@ InitVM_Object(void)
}
#include "kernel.rbinc"
+#include "nilclass.rbinc"
void
Init_Object(void)