mirror of
https://github.com/python/cpython.git
synced 2026-01-26 21:03:34 +00:00
gh-141968: use bytearray.take_bytes in wave._byteswap (#141973)
This commit is contained in:
parent
2c1fdf3592
commit
9dbf77beb6
@ -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…
x
Reference in New Issue
Block a user