[PATCH 5 of 6 V7] dirstate: add a C implementation for nonnormalentries
Yuya Nishihara
yuya at tcha.org
Sat Jan 2 03:00:12 CST 2016
On Fri, 1 Jan 2016 16:58:00 -0800, Bryan O'Sullivan wrote:
> On Wed, Dec 23, 2015 at 1:20 PM, Laurent Charignon <lcharignon at fb.com>
> wrote:
> > + if (!PyArg_ParseTuple(args, "O!:nonnormalentries",
> > + &PyDict_Type, &dmap))
> > + goto bail;
> > +
> > + nonnset = PySet_New(NULL);
> > + if (nonnset == NULL)
> > + goto bail;
> >
>
> We normally reserve "goto bail" for cases where there's cleanup needed. In
> these two cases there's no cleanup required, so it's clearer to simply
> "return NULL".
I wrote it. I prefer using a common exit point after allocation. But this
function is simple enough to see if cleanup is necessary or not, so please
feel free to change them to "return NULL".
More information about the Mercurial-devel
mailing list