diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -526,14 +526,11 @@ hash_each_key(hash) } static int -each_pair_i(key, value, rev) +each_pair_i(key, value) VALUE key, value; { if (key == Qnil) return ST_CONTINUE; - if (rev) - rb_yield(assoc_new(value, key)); - else - rb_yield(assoc_new(key, value)); + rb_yield(assoc_new(key, value)); return ST_CONTINUE; } @@ -545,14 +542,6 @@ hash_each_pair(hash) return hash; } -static VALUE -hash_each_with_index(hash) - VALUE hash; -{ - hash_foreach(hash, each_pair_i, 1); - return hash; -} - static int to_a_i(key, value, ary) VALUE key, value, ary; @@ -1149,7 +1138,6 @@ Init_Hash() rb_define_method(cHash,"each_value", hash_each_value, 0); rb_define_method(cHash,"each_key", hash_each_key, 0); rb_define_method(cHash,"each_pair", hash_each_pair, 0); - rb_define_method(cHash,"each_with_index", hash_each_with_index, 0); rb_define_method(cHash,"keys", hash_keys, 0); rb_define_method(cHash,"values", hash_values, 0); |