bpo-39496: Remove redundant checks from _sqlite/cursor.c (GH-18270)
This commit is contained in:
parent
b94737a4af
commit
78c7183f47
|
@ -786,17 +786,9 @@ PyObject* pysqlite_cursor_fetchmany(pysqlite_Cursor* self, PyObject* args, PyObj
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* just make sure we enter the loop */
|
||||
row = Py_None;
|
||||
|
||||
while (row) {
|
||||
row = pysqlite_cursor_iternext(self);
|
||||
if (row) {
|
||||
while ((row = pysqlite_cursor_iternext(self))) {
|
||||
PyList_Append(list, row);
|
||||
Py_DECREF(row);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
Py_XDECREF(row);
|
||||
|
||||
if (++counter == maxrows) {
|
||||
break;
|
||||
|
@ -821,15 +813,9 @@ PyObject* pysqlite_cursor_fetchall(pysqlite_Cursor* self, PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* just make sure we enter the loop */
|
||||
row = (PyObject*)Py_None;
|
||||
|
||||
while (row) {
|
||||
row = pysqlite_cursor_iternext(self);
|
||||
if (row) {
|
||||
while ((row = pysqlite_cursor_iternext(self))) {
|
||||
PyList_Append(list, row);
|
||||
Py_DECREF(row);
|
||||
}
|
||||
Py_XDECREF(row);
|
||||
}
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
|
|
Loading…
Reference in New Issue