1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Prefer IO#wait_readable over IO#select. (https://github.com/ruby/irb/pull/323)

https://github.com/ruby/irb/commit/1c03bd3373
This commit is contained in:
Samuel Williams 2021-12-29 13:37:01 +13:00 committed by git
parent f27eb8148f
commit e4cd319f3d

View file

@ -84,8 +84,7 @@ module IRB
#
# See IO#eof? for more information.
def eof?
rs, = IO.select([@stdin], [], [], 0.00001)
if rs and rs[0]
if @stdin.wait_readable(0.00001)
c = @stdin.getc
result = c.nil? ? true : false
@stdin.ungetc(c) unless c.nil?