mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io/io.c (io_init): remove redundant code
This commit is contained in:
@@ -156,7 +156,7 @@ static int
|
||||
io_mode_to_flags(mrb_state *mrb, mrb_value mode)
|
||||
{
|
||||
if (mrb_nil_p(mode)) {
|
||||
return io_modestr_to_flags(mrb, "r");
|
||||
return O_RDONLY;
|
||||
}
|
||||
else if (mrb_string_p(mode)) {
|
||||
return io_modestr_to_flags(mrb, RSTRING_CSTR(mrb, mode));
|
||||
@@ -704,13 +704,6 @@ io_init(mrb_state *mrb, mrb_value io)
|
||||
check_file_descriptor(mrb, fd);
|
||||
break;
|
||||
}
|
||||
if (mrb_nil_p(mode)) {
|
||||
mode = mrb_str_new_cstr(mrb, "r");
|
||||
}
|
||||
if (mrb_nil_p(opt)) {
|
||||
opt = mrb_hash_new(mrb);
|
||||
}
|
||||
|
||||
flags = io_mode_to_flags(mrb, mode);
|
||||
|
||||
mrb_iv_set(mrb, io, MRB_IVSYM(buf), mrb_str_new_cstr(mrb, ""));
|
||||
|
||||
Reference in New Issue
Block a user