lib/impls/reader_iobuf.rb in bychar-2.0.0 vs lib/impls/reader_iobuf.rb in bychar-3.0.0
- old
+ new
@@ -8,12 +8,12 @@
end
# Since you parse char by char, you will be tempted to do it in a tight loop
# and to call eof? on each iteration. Don't. Instead. allow it to raise and do not check.
# This takes the profile time down from 36 seconds to 30 seconds for a large file.
- def read_one_char!
+ def read_one_char
cache if @buf.eos?
- raise EOF if @buf.eos?
+ return nil if @buf.eos?
@buf.getch
end
private
\ No newline at end of file