[Patches] [Patch #103100] Multicharacter replacements in PyUnicode_TranslateCharmap

noreply@sourceforge.net noreply@sourceforge.net
Thu, 04 Jan 2001 11:09:49 -0800


Patch #103100 has been updated. 

Project: python
Category: core (C code)
Status: Open
Submitted by: doerwalter
Assigned to : lemburg
Summary: Multicharacter replacements in PyUnicode_TranslateCharmap

Follow-Ups:

Date: 2001-Jan-04 10:33
By: nobody

Comment:
I like the idea, but the implementation needs some reworking:
the common case is 1-1 mapping so this should be as fast
as possible; extra size checks slow things down too much.

You can take a different approach, though:
leave things as they are and only add a special case for the 1-n
which does resizing depending on how many extra chars are inserted.
Then as final step, if resizing occurred, call _PyUnicode_Resize()
to cut down the allocate buffer to its true size.

-- Marc-Andre
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=103100&group_id=5470