diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-23 12:42:57 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-23 12:42:57 +0000 |
commit | ca7835bec6714f0704a32a25d2c23e465f3c10b2 (patch) | |
tree | 50db1476fe90a7e0afb363383656bce7389cb766 /hash.c | |
parent | d8918fa6b5ecf660ebdb5530fa971e324f6847bb (diff) | |
download | bundler-ca7835bec6714f0704a32a25d2c23e465f3c10b2.tar.gz |
hash.c: rb_hash_delete does not call the block
* hash.c (rb_hash_delete): now does not call the block given to
the current method. [ruby-core:65861] [Bug #10413]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -972,8 +972,8 @@ rb_hash_index(VALUE hash, VALUE value) return rb_hash_key(hash, value); } -static VALUE -rb_hash_delete_key(VALUE hash, VALUE key) +VALUE +rb_hash_delete(VALUE hash, VALUE key) { st_data_t ktmp = (st_data_t)key, val; @@ -1008,13 +1008,13 @@ rb_hash_delete_key(VALUE hash, VALUE key) * */ -VALUE -rb_hash_delete(VALUE hash, VALUE key) +static VALUE +rb_hash_delete_m(VALUE hash, VALUE key) { VALUE val; rb_hash_modify_check(hash); - val = rb_hash_delete_key(hash, key); + val = rb_hash_delete(hash, key); if (val != Qundef) return val; if (rb_block_given_p()) { return rb_yield(key); @@ -1066,7 +1066,7 @@ rb_hash_shift(VALUE hash) else { rb_hash_foreach(hash, shift_i_safe, (VALUE)&var); if (var.key != Qundef) { - rb_hash_delete_key(hash, var.key); + rb_hash_delete(hash, var.key); return rb_assoc_new(var.key, var.val); } } @@ -3881,7 +3881,7 @@ Init_Hash(void) rb_define_method(rb_cHash,"values_at", rb_hash_values_at, -1); rb_define_method(rb_cHash,"shift", rb_hash_shift, 0); - rb_define_method(rb_cHash,"delete", rb_hash_delete, 1); + rb_define_method(rb_cHash,"delete", rb_hash_delete_m, 1); rb_define_method(rb_cHash,"delete_if", rb_hash_delete_if, 0); rb_define_method(rb_cHash,"keep_if", rb_hash_keep_if, 0); rb_define_method(rb_cHash,"select", rb_hash_select, 0); |