@@ -125,10 +125,7 @@ def _readinto_unlocked(self, b: bytearray) -> int:
125
125
if size is not None :
126
126
remaining = size - self ._pos
127
127
128
- if n == - 1 :
129
- n = remaining
130
- else :
131
- n = min (n , remaining )
128
+ n = remaining if n == - 1 else min (n , remaining )
132
129
133
130
# Short path for when it turns out we don't need to read anything
134
131
if n == 0 or size is not None and size <= self ._pos :
@@ -182,8 +179,9 @@ def _read(self, offset: int, length: int) -> bytes:
182
179
def _readinto (self , offset : int , buf : memoryview ) -> int :
183
180
"""Provide an aligned ``readinto`` implementation for this stream.
184
181
185
- For backwards compatibility, ``AlignedStream`` provides a default ``_readinto`` implementation, implemented in `_readinto_fallback`, that
186
- falls back on ``_read``. However, subclasses should override the ``_readinto`` method instead of ``_readinto_fallback``.
182
+ For backwards compatibility, ``AlignedStream`` provides a default ``_readinto`` implementation, implemented
183
+ in ``_readinto_fallback``, that falls back on ``_read``. However, subclasses should override the ``_readinto``
184
+ method instead of ``_readinto_fallback``.
187
185
"""
188
186
return self ._readinto_fallback (offset , buf )
189
187
@@ -244,7 +242,6 @@ def peek(self, n: int = 0) -> bytes:
244
242
245
243
def close (self ) -> None :
246
244
"""Close the stream. Does nothing by default."""
247
- pass
248
245
249
246
250
247
class RangeStream (AlignedStream ):
0 commit comments