Mercurial > cpython-lru_cache-weakref
diff Python/formatter_unicode.c @ 72705:05ed6e5f2cf4
Add asciilib: similar to ucs1, ucs2 and ucs4 library, but specialized to ASCII
ucs1, ucs2 and ucs4 libraries have to scan created substring to find the
maximum character, whereas it is not need to ASCII strings. Because ASCII
strings are common, it is useful to optimize ASCII.
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Wed, 05 Oct 2011 21:24:08 +0200 |
| parents | f05c2df39ea8 |
| children | 6f03716079a9 |
line wrap: on
line diff
--- a/Python/formatter_unicode.c Wed Oct 05 20:58:25 2011 +0200 +++ b/Python/formatter_unicode.c Wed Oct 05 21:24:08 2011 +0200 @@ -501,7 +501,7 @@ spec->n_grouped_digits = 0; else spec->n_grouped_digits = _PyUnicode_InsertThousandsGrouping( - PyUnicode_1BYTE_KIND, NULL, 0, NULL, + NULL, PyUnicode_1BYTE_KIND, NULL, 0, NULL, spec->n_digits, spec->n_min_width, locale->grouping, locale->thousands_sep); @@ -603,7 +603,7 @@ r = #endif _PyUnicode_InsertThousandsGrouping( - kind, + out, kind, (char*)data + PyUnicode_KIND_SIZE(kind, pos), spec->n_grouped_digits, pdigits + PyUnicode_KIND_SIZE(kind, d_pos),
