-
- Downloads
py/objstr: Optimize string concatenation with empty string.
In this, don't allocate copy, just return non-empty string. This helps with a standard pattern of buffering data in case of short reads: buf = b"" while ...: s = f.read(...) buf += s ... For a typical case when single read returns all data needed, there won't be extra allocation. This optimization helps uasyncio.
Please register or sign in to comment