Skip to content

Commit

Permalink
BufferedInputBase pre-reserves data to DEFAULT_BUFFER_SIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
terencezl committed Sep 11, 2019
1 parent ac3db9b commit aeba3c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion smart_open/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ def read(self, size=-1):
# Fill our buffer to the required size.
#
# logger.debug('filling %r byte-long buffer up to %r bytes', len(self._buffer), size)
self._fill_buffer(size)
fill_size = size if size > DEFAULT_BUFFER_SIZE else DEFAULT_BUFFER_SIZE
self._fill_buffer(fill_size)
return self._read_from_buffer(size)

def read1(self, size=-1):
Expand Down

0 comments on commit aeba3c5

Please sign in to comment.