diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-20 17:03:27 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-20 17:03:27 +0000 |
commit | 19569c8f2596f340b821f104588c59e00b08773d (patch) | |
tree | 15fc9f7323adaf287d0010f0607b2dfd7d907d98 /io.c | |
parent | 4a2cd03fbd73cefdc87e9602dc3dd1cf86a5a63d (diff) |
* io.c (open_key_args): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -6690,12 +6690,9 @@ open_key_args(int argc, VALUE *argv, struct foreach_arg *arg) return; } v = rb_hash_aref(opt, sym_mode); - if (!NIL_P(v)) { - arg->io = rb_io_open(RSTRING_PTR(argv[0]), v, opt); - } - else { - arg->io = rb_io_open(RSTRING_PTR(argv[0]), INT2NUM(O_RDONLY), opt); - } + if (NIL_P(v)) + v = INT2NUM(O_RDONLY); + arg->io = rb_io_open(RSTRING_PTR(argv[0]), v, opt); } static VALUE |