summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 12:33:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 12:33:42 +0000
commit1b27af8d56a0aa2dd2df167f5e6c9c14d02c0365 (patch)
tree3488552d614682cca6049d89c4f791f16deef1a4 /io.c
parent7da5b32a7df809783726a9aa2d37ed56822f91c7 (diff)
io.c: let rb_p use writev
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/io.c b/io.c
index 5e44899b7a..64012e77f5 100644
--- a/io.c
+++ b/io.c
@@ -7640,15 +7640,15 @@ rb_f_puts(int argc, VALUE *argv, VALUE recv)
void
rb_p(VALUE obj) /* for debug print within C code */
{
- VALUE str = rb_obj_as_string(rb_inspect(obj));
+ VALUE args[2];
+ args[0] = rb_obj_as_string(rb_inspect(obj));
+ args[1] = rb_default_rs;
if (RB_TYPE_P(rb_stdout, T_FILE) &&
rb_method_basic_definition_p(CLASS_OF(rb_stdout), id_write)) {
- io_write(rb_stdout, str, 1);
- io_write(rb_stdout, rb_default_rs, 0);
+ io_writev(2, args, rb_stdout);
}
else {
- rb_io_write(rb_stdout, str);
- rb_io_write(rb_stdout, rb_default_rs);
+ rb_io_writev(rb_stdout, 2, args);
}
}