From b50032c8eda65e3aca62f13fd13129e70e8e1138 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 6 May 2003 06:51:31 +0000 Subject: * object.c (rb_obj_methods): list singleton methods if recur argument is false; list all methods otherwise. * numeric.c (num_step): double epsilon to make "1.1.step(1.5,0.1)" to work. * ext/gdbm/gdbm.c (fgdbm_values_at): new method to replace select(index..). * ext/sdbm/init.c (fsdbm_values_at): ditto. * ext/dbm/dbm.c (fdbm_values_at): ditto. * ext/dbm/dbm.c (DBM::VERSION): defined. * ext/gdbm/testgdbm.rb: replace select with values_at. * ext/sdbm/testsdbm.rb: ditto. * ext/dbm/testdbm.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index e5aa6cf10..05dd2c849 100644 --- a/hash.c +++ b/hash.c @@ -533,13 +533,15 @@ rb_hash_select(argc, argv, hash) long i; if (!rb_block_given_p()) { +#if RUBY_VERSION_CODE < 181 rb_warn("Hash#select(key..) is deprecated; use Hash#values_at"); +#endif return rb_hash_values_at(argc, argv, hash); } - result = rb_ary_new(); if (argc > 0) { rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc); } + result = rb_ary_new(); rb_hash_foreach(hash, select_i, result); return result; } -- cgit