Skip to content

Commit 14b51ba

Browse files
authored
Prefer to use RTEST when checking result of rb_io_wait. (#5341)
* Prefer to use RTEST when checking result of `rb_io_wait`. * Consistently use false for signifying no events ready.
1 parent 618979a commit 14b51ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/io/console/console.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ console_getch(int argc, VALUE *argv, VALUE io)
556556
if (!(w & RB_WAITFD_IN)) return Qnil;
557557
# else
558558
VALUE result = rb_io_wait(io, RUBY_IO_READABLE, timeout);
559-
if (result == Qfalse) return Qnil;
559+
if (!RTEST(result)) return Qnil;
560560
# endif
561561
}
562562
else if (optp->vtime) {

0 commit comments

Comments
 (0)