return NULL;
}
- /* just make sure we enter the loop */
- row = Py_None;
-
- while (row) {
- row = pysqlite_cursor_iternext(self);
- if (row) {
- PyList_Append(list, row);
- Py_DECREF(row);
- } else {
- break;
- }
+ while ((row = pysqlite_cursor_iternext(self))) {
+ PyList_Append(list, row);
+ Py_XDECREF(row);
if (++counter == maxrows) {
break;
return NULL;
}
- /* just make sure we enter the loop */
- row = (PyObject*)Py_None;
-
- while (row) {
- row = pysqlite_cursor_iternext(self);
- if (row) {
- PyList_Append(list, row);
- Py_DECREF(row);
- }
+ while ((row = pysqlite_cursor_iternext(self))) {
+ PyList_Append(list, row);
+ Py_XDECREF(row);
}
if (PyErr_Occurred()) {