aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/io.c b/io.c
index ac35e1ee4f..1a22d34c50 100644
--- a/io.c
+++ b/io.c
@@ -7878,12 +7878,7 @@ rb_obj_display(int argc, VALUE *argv, VALUE self)
{
VALUE out;
- if (argc == 0) {
- out = rb_stdout;
- }
- else {
- rb_scan_args(argc, argv, "01", &out);
- }
+ out = (!rb_check_arity(argc, 0, 1) ? rb_stdout : argv[0]);
rb_io_write(out, self);
return Qnil;