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

Use short wait for select(2)

It is one of the reasons why paste to IRB is slow.
This commit is contained in:
aycabta 2019-09-23 17:31:41 +09:00
parent 934507472c
commit b443bdbdb9

View file

@ -26,7 +26,7 @@ class Reline::ANSI
end
c = nil
loop do
result = select([@@input], [], [], 0.1)
result = select([@@input], [], [], 0.001)
next if result.nil?
c = @@input.read(1)
break
@ -39,7 +39,7 @@ class Reline::ANSI
end
def self.retrieve_keybuffer
result = select([@@input], [], [], 0.1)
result = select([@@input], [], [], 0.001)
return if result.nil?
str = @@input.read_nonblock(1024)
str.bytes.each do |c|