Skip to content
Prev Previous commit
Next Next commit
Reduce diff
  • Loading branch information
nineteendo committed May 13, 2025
commit 822ea8626036a4572387819b3abf921a49750852
10 changes: 5 additions & 5 deletions Modules/_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ write_newline_indent(PyUnicodeWriter *writer,
Py_ssize_t indent_level, PyObject *indent_cache)
{
PyObject *newline_indent = PyList_GET_ITEM(indent_cache, indent_level * 2);
return _PyUnicodeWriter_WriteStr((_PyUnicodeWriter *)writer, newline_indent);
return PyUnicodeWriter_WriteStr(writer, newline_indent);
}


Expand Down Expand Up @@ -1461,7 +1461,7 @@ static int
_steal_accumulate(PyUnicodeWriter *writer, PyObject *stolen)
{
/* Append stolen and then decrement its reference count */
int rval = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter *)writer, stolen);
int rval = PyUnicodeWriter_WriteStr(writer, stolen);
Py_DECREF(stolen);
return rval;
}
Expand Down Expand Up @@ -1611,7 +1611,7 @@ encoder_encode_key_value(PyEncoderObject *s, PyUnicodeWriter *writer, bool *firs
*first = false;
}
else {
if (_PyUnicodeWriter_WriteStr((_PyUnicodeWriter *)writer, item_separator) < 0) {
if (PyUnicodeWriter_WriteStr(writer, item_separator) < 0) {
Py_DECREF(keystr);
return -1;
}
Expand All @@ -1626,7 +1626,7 @@ encoder_encode_key_value(PyEncoderObject *s, PyUnicodeWriter *writer, bool *firs
if (_steal_accumulate(writer, encoded) < 0) {
return -1;
}
if (_PyUnicodeWriter_WriteStr((_PyUnicodeWriter *)writer, s->key_separator) < 0) {
if (PyUnicodeWriter_WriteStr(writer, s->key_separator) < 0) {
return -1;
}
if (encoder_listencode_obj(s, writer, value, indent_level, indent_cache) < 0) {
Expand Down Expand Up @@ -1789,7 +1789,7 @@ encoder_listencode_list(PyEncoderObject *s, PyUnicodeWriter *writer,
for (i = 0; i < PySequence_Fast_GET_SIZE(s_fast); i++) {
PyObject *obj = PySequence_Fast_GET_ITEM(s_fast, i);
if (i) {
if (_PyUnicodeWriter_WriteStr((_PyUnicodeWriter *)writer, separator) < 0)
if (PyUnicodeWriter_WriteStr(writer, separator) < 0)
goto bail;
}
if (encoder_listencode_obj(s, writer, obj, indent_level, indent_cache)) {
Expand Down
Loading