From 14cf94d4aae8240b275d231ad542b78dfa95f396 Mon Sep 17 00:00:00 2001 From: buty4649 Date: Sat, 20 Jan 2024 00:51:18 +0900 Subject: [PATCH] Remove bug fix code --- mrblib/rf/buffered_io.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mrblib/rf/buffered_io.rb b/mrblib/rf/buffered_io.rb index 6c13dcd..6597db4 100644 --- a/mrblib/rf/buffered_io.rb +++ b/mrblib/rf/buffered_io.rb @@ -21,16 +21,8 @@ def gets fill_buffer if @buffer.empty? break if @buffer.empty? - if @buffer =~ /\n/ - # bug: In the case of binary files, String#index enters an infinite loop, thus returning the entire buffer. - # see. https://github.com/mruby/mruby/issues/6143 - if @binary - line = @buffer.slice!(0..-1) - @buffer.clear - break - end - - newline_index = @buffer.index("\n") + newline_index = @buffer.index("\n") + if newline_index line << @buffer.slice!(0..newline_index) break else