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:
parent
f27eb8148f
commit
e4cd319f3d
1 changed files with 1 additions and 2 deletions
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue