From 0390fc54a4924aa219eaec2be981ef05acd60be7 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 30 May 2002 06:12:29 +0000 Subject: * range.c (range_step): iteration done using "+" if elements are Numeric. Otherwise using "succ". * range.c (range_each): iteration done using "succ". If the elements does not respond to "succ", raise TypeError. As a result, all Enumerable methods, e.g. collect, require elements to respond to "succ'. * range.c (range_member): comparison done using "each", if elements are non-Numeric or no-"succ" objects. Otherwise compare using "<=>". * range.c (Init_Range): remove "size" and "length". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- time.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'time.c') diff --git a/time.c b/time.c index 971d21dfa..3d1667631 100644 --- a/time.c +++ b/time.c @@ -690,16 +690,6 @@ time_usec(time) return INT2NUM(tobj->tv.tv_usec); } -static VALUE -time_succ(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - return rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec); -} - static VALUE time_cmp(time1, time2) VALUE time1, time2; @@ -1449,8 +1439,6 @@ Init_Time() rb_define_method(rb_cTime, "hash", time_hash, 0); rb_define_method(rb_cTime, "clone", time_clone, 0); rb_define_method(rb_cTime, "dup", time_dup, 0); - rb_define_method(rb_cTime, "succ", time_succ, 0); - rb_define_method(rb_cTime, "next", time_succ, 0); rb_define_method(rb_cTime, "localtime", time_localtime, 0); rb_define_method(rb_cTime, "gmtime", time_gmtime, 0); -- cgit