summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-12-25 02:26:06 +1300
committerGitHub <noreply@github.com>2021-12-25 02:26:06 +1300
commit548c8f5f7aa743ae05610ed372f857a6b488e89c (patch)
treebdc446ba451f08e777c89c57d8ea23de6ed61fdb /ext
parent4f74153846d951dd8ec66017f4e8e286df8ea925 (diff)
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.
Notes
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'ext')
-rw-r--r--ext/io/console/console.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index 5dec1a4c06..4c5f89f80d 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -556,7 +556,7 @@ console_getch(int argc, VALUE *argv, VALUE io)
if (!(w & RB_WAITFD_IN)) return Qnil;
# else
VALUE result = rb_io_wait(io, RUBY_IO_READABLE, timeout);
- if (result == Qfalse) return Qnil;
+ if (!RTEST(result)) return Qnil;
# endif
}
else if (optp->vtime) {