]> granicus.if.org Git - python/commit
Optimize error handlers of ASCII and Latin1 encoders when the replacement
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Oct 2015 11:10:05 +0000 (13:10 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Oct 2015 11:10:05 +0000 (13:10 +0200)
commit6bd525b656f75c9752d39d9c4be1e1b29fa67cdb
tree645853491c0ae3addc1f578dfe0b5345b3cd7b0f
parentce179bf6baed91ba84cc3ff647e96287c3b8e2f2
Optimize error handlers of ASCII and Latin1 encoders when the replacement
string is pure ASCII: use _PyBytesWriter_WriteBytes(), don't check individual
character.

Cleanup unicode_encode_ucs1():

* Rename repunicode to rep
* Clear rep object on error
* Factorize code between bytes and unicode path
Objects/stringlib/codecs.h
Objects/unicodeobject.c