8000 Make the number of arguments of `Hash#merge` variable by liwii · Pull Request #1951 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Make the number of arguments of Hash#merge variable #1951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix document and correct variable declaration
  • Loading branch information
liwii committed Sep 15, 2018
commit 8a470b7caaa3ed1a79c021d7a98d4c26af0fca5a
4 changes: 2 additions & 2 deletions hash.c
3880
Original file line number Diff line number Diff line change
Expand Up @@ -2607,9 +2607,9 @@ static VALUE
rb_hash_update(int argc, VALUE *argv, VALUE self)
{
int i;
bool block_given = rb_block_given_p();

rb_hash_modify(self);
bool block_given = rb_block_given_p();
for(i = 0; i < argc; i++){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation and style in block differ than others.

VALUE hash = to_hash(argv[i]);
if (block_given) {
Expand Down Expand Up @@ -2694,7 +2694,7 @@ rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func)
* More than one hash can be given to this method as arguments, then
* the method returns a new hash containing the contents of the reciever
* itself and all hashes given as arguments. The method also can be called
* with no argument, then the receiver itself will be returned;
* with no argument, then a new hash, whose content is same as that of receiver, will be returned;
*
* h1 = { "a" => 100, "b" => 200 }
* h2 = { "b" => 254, "c" => 300 }
Expand Down
0