mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-141968: use bytearray.take_bytes in wave._byteswap (#141973)
This commit is contained in:
parent
2c1fdf3592
commit
9dbf77beb6
2 changed files with 3 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ def _byteswap(data, width):
|
|||
for j in range(width):
|
||||
swapped_data[i + width - 1 - j] = data[i + j]
|
||||
|
||||
return bytes(swapped_data)
|
||||
return swapped_data.take_bytes()
|
||||
|
||||
|
||||
class _Chunk:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Remove data copy from :func:`wave.Wave_read.readframes` and
|
||||
:func:`wave.Wave_write.writeframes` by using :func:`bytearray.take_bytes`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue