Commit 793a720
committed
Write float repr directly into UnicodeWriter in JSON encoder
For finite float values, format into a stack buffer with
_Py_double_repr_buffered() and write the bytes straight into the
encoder's writer with PyUnicodeWriter_WriteASCII(), instead of
building an intermediate PyUnicode object via tp_repr. Non-finite
values fall through to encoder_encode_float() so that allow_nan
semantics are preserved.1 parent b2c23f1 commit 793a720
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
1597 | 1598 | | |
1598 | 1599 | | |
1599 | 1600 | | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
1600 | 1610 | | |
1601 | 1611 | | |
1602 | 1612 | | |
| |||
0 commit comments