[PATCH V3] obsolete: use C code for headrevs calculation

Durham Goode durham at fb.com
Thu Sep 18 13:13:01 CDT 2014


On 9/18/14, 4:24 AM, Antoine Pitrou wrote:
> On Wed, 17 Sep 2014 19:01:01 -0700
> Durham Goode <durham at fb.com> wrote:
>>   
>> -static PyObject *index_headrevs(indexObject *self)
>> +static int check_filter(PyObject *filter, Py_ssize_t arg, int *isfiltered) {
> That's complicated. Why doesn't your function return either 1, 0 or -1?
> By the way, PyObject_IsTrue() does exactly that :-)
> (meaning you should check its error return as well, or return it
> directly)
Overloading the return value to mean multiple things seemed odd. But if 
that's a standard pattern, I'll do that.


More information about the Mercurial-devel mailing list