On Fri, Feb 06, 2004 at 11:04:59AM -0800, rhettinger at users.sourceforge.net wrote: > > + static PyObject * > + deque_extend(dequeobject *deque, PyObject *iterable) > + { > + PyObject *it, *item; > + > + it = PyObject_GetIter(iterable); > + if (it == NULL) > + return NULL; > + > + while ((item = PyIter_Next(it)) != NULL) { > + deque->rightindex++; > + deque->len++; > + if (deque->rightindex == BLOCKLEN) { > + block *b = newblock(deque->rightblock, NULL); > + if (b == NULL) > + return NULL; In deque_extend and deque_extendleft, doesn't there need to be a Py_DECREF(it); before returning when newblock fails? > + assert(deque->rightblock->rightlink == NULL); > + deque->rightblock->rightlink = b; > + deque->rightblock = b; > + deque->rightindex = 0; > + } > + Py_INCREF(item); > + deque->rightblock->data[deque->rightindex] = item; > + } > + Py_DECREF(it); > + if (PyErr_Occurred()) > + return NULL; > + Py_RETURN_NONE; > + }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4