[前][次][番号順一覧][スレッド一覧]

ruby-changes:70644

From: Samuel <ko1@a...>
Date: Wed, 29 Dec 2021 09:37:16 +0900 (JST)
Subject: [ruby-changes:70644] e4cd319f3d (master): [ruby/irb] Prefer `IO#wait_readable` over `IO#select`. (https://github.com/ruby/irb/pull/323)

https://git.ruby-lang.org/ruby.git/commit/?id=e4cd319f3d

From e4cd319f3d6560b76dbc1c7e89aa4d790a2d1e43 Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@o...>
Date: Wed, 29 Dec 2021 13:37:01 +1300
Subject: [ruby/irb] Prefer `IO#wait_readable` over `IO#select`.
 (https://github.com/ruby/irb/pull/323)

https://github.com/ruby/irb/commit/1c03bd3373
---
 lib/irb/input-method.rb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index f965290ac8e..64276e61be2 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -84,8 +84,7 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/input-method.rb#L84
     #
     # 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?
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]