Skip to content

Commit 1c03bd3

Browse files
authored
Prefer IO#wait_readable over IO#select. (#323)
1 parent b1d9c34 commit 1c03bd3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/irb/input-method.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ def gets
8484
#
8585
# See IO#eof? for more information.
8686
def eof?
87-
rs, = IO.select([@stdin], [], [], 0.00001)
88-
if rs and rs[0]
87+
if @stdin.wait_readable(0.00001)
8988
c = @stdin.getc
9089
result = c.nil? ? true : false
9190
@stdin.ungetc(c) unless c.nil?

0 commit comments

Comments
 (0)