1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* hash.c (delete_if_i): use st_delete_safe() (via

rb_hash_delete()) instead of returning ST_DELETE.
  backport from HEAD.  [ruby-dev:23487]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2004-05-13 05:27:24 +00:00
parent 32d051b692
commit 30a9fd3f17
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,9 @@
Thu May 13 14:23:45 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* hash.c (delete_if_i): use st_delete_safe() (via
rb_hash_delete()) instead of returning ST_DELETE.
backport from HEAD. [ruby-dev:23487]
Thu May 13 13:01:30 2004 akira yamada <akira@ruby-lang.org>
* lib/uri/mailto.rb (URI::MailTo::to_s): should include fragment.

11
hash.c
View file

@ -679,12 +679,13 @@ rb_hash_shift(hash)
}
static enum st_retval
delete_if_i(key, value)
VALUE key, value;
delete_if_i(key, value, hash)
VALUE key, value, hash;
{
if (key == Qundef) return ST_CONTINUE;
if (RTEST(rb_yield_values(2, key, value)))
return ST_DELETE;
if (RTEST(rb_yield_values(2, key, value))) {
rb_hash_delete(hash, key);
}
return ST_CONTINUE;
}
@ -705,7 +706,7 @@ rb_hash_delete_if(hash)
VALUE hash;
{
rb_hash_modify(hash);
rb_hash_foreach(hash, delete_if_i, 0);
rb_hash_foreach(hash, delete_if_i, hash);
return hash;
}