Skip to content

Commit

Permalink
[ruby/irb] Prefer IO#wait_readable over IO#select. (ruby/irb#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix authored and matzbot committed Dec 29, 2021
1 parent f27eb81 commit e4cd319
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/irb/input-method.rb
Expand Up @@ -84,8 +84,7 @@ def gets
#
# 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?
Expand Down

0 comments on commit e4cd319

Please sign in to comment.