Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions pandas/_libs/src/ujson/python/objToJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,15 +925,15 @@ char *Tuple_iterGetName(JSOBJ Py_UNUSED(obj), JSONTypeContext *Py_UNUSED(tc),
}

//=============================================================================
// Iterator iteration functions
// Set iteration functions
// itemValue is borrowed reference, no ref counting
//=============================================================================
void Iter_iterBegin(JSOBJ obj, JSONTypeContext *tc) {
void Set_iterBegin(JSOBJ obj, JSONTypeContext *tc) {
GET_TC(tc)->itemValue = NULL;
GET_TC(tc)->iterator = PyObject_GetIter(obj);
}

int Iter_iterNext(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
int Set_iterNext(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
PyObject *item;

if (GET_TC(tc)->itemValue) {
Expand All @@ -951,7 +951,7 @@ int Iter_iterNext(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
return 1;
}

void Iter_iterEnd(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
void Set_iterEnd(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
if (GET_TC(tc)->itemValue) {
Py_DECREF(GET_TC(tc)->itemValue);
GET_TC(tc)->itemValue = NULL;
Expand All @@ -963,11 +963,11 @@ void Iter_iterEnd(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
}
}

JSOBJ Iter_iterGetValue(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
JSOBJ Set_iterGetValue(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc) {
return GET_TC(tc)->itemValue;
}

char *Iter_iterGetName(JSOBJ Py_UNUSED(obj), JSONTypeContext *Py_UNUSED(tc),
char *Set_iterGetName(JSOBJ Py_UNUSED(obj), JSONTypeContext *Py_UNUSED(tc),
size_t *Py_UNUSED(outLen)) {
return NULL;
}
Expand Down Expand Up @@ -2040,11 +2040,11 @@ void Object_beginTypeContext(JSOBJ _obj, JSONTypeContext *tc) {
} else if (PyAnySet_Check(obj)) {
PRINTMARK();
tc->type = JT_ARRAY;
pc->iterBegin = Iter_iterBegin;
pc->iterEnd = Iter_iterEnd;
pc->iterNext = Iter_iterNext;
pc->iterGetValue = Iter_iterGetValue;
pc->iterGetName = Iter_iterGetName;
pc->iterBegin = Set_iterBegin;
pc->iterEnd = Set_iterEnd;
pc->iterNext = Set_iterNext;
pc->iterGetValue = Set_iterGetValue;
pc->iterGetName = Set_iterGetName;
return;
}

Expand Down