summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index 560b32e29a..84a80bd086 100644
--- a/hash.c
+++ b/hash.c
@@ -323,9 +323,7 @@ rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
rb_hash_modify(hash);
if (rb_block_given_p()) {
- if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number of arguments");
- }
+ rb_check_arity(argc, 0, 0);
ifnone = rb_block_proc();
default_proc_arity_check(ifnone);
RHASH_IFNONE(hash) = ifnone;