Revert "gh-129005: _pyio.BufferedIO remove copy on readall (#129454)" (#129500)

This reverts commit e1c4ba9288.
This commit is contained in:
Cody Maloney 2025-01-31 00:40:44 -08:00 committed by GitHub
parent c07ac3c86a
commit 3ebe3d7688
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 5 deletions

View file

@ -1062,9 +1062,6 @@ class BufferedReader(_BufferedIOMixin):
if chunk is None:
return buf[pos:] or None
else:
# Avoid slice + copy if there is no data in buf
if not buf:
return chunk
return buf[pos:] + chunk
chunks = [buf[pos:]] # Strip the consumed bytes.
current_size = 0