mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io/io.c (mrb_io_readchar): avoid redundant call to mrb_utf8len()
This commit is contained in:
@@ -1524,8 +1524,8 @@ mrb_io_readchar(mrb_state *mrb, mrb_value self)
|
||||
n = read(fptr->fd, RSTRING_PTR(buf)+blen, 4096-blen);
|
||||
if (n < 0) mrb_sys_fail(mrb, "sysread failed");
|
||||
mrb_str_resize(mrb, buf, blen+n);
|
||||
len = mrb_utf8len(RSTRING_PTR(buf), RSTRING_END(buf));
|
||||
}
|
||||
len = mrb_utf8len(RSTRING_PTR(buf), RSTRING_END(buf));
|
||||
}
|
||||
#endif
|
||||
return io_bufread(mrb, buf, len);
|
||||
|
||||
Reference in New Issue
Block a user