mruby-io/io.c (mrb_io_readchar): avoid redundant call to mrb_utf8len()

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-12-27 16:10:46 +09:00
parent 2970607267
commit 8a6344b64f
+1 -1
View File
@@ -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);