[PATCH 2 of 3] inotify: _inotify.c: do not use "goto bail" and XDECREF's when returns can do

Bryan O'Sullivan bos at serpentine.com
Mon Aug 31 12:31:53 CDT 2009


On Thu, Aug 27, 2009 at 3:01 AM, Nicolas Dumazet <nicdumz at gmail.com> wrote:

> inotify: _inotify.c: do not use "goto bail" and XDECREF's when returns can
> do
>
> Using gotos hurt code readability: it's not necessary to put a goto to a
> label
> containing fail-safe instructions (Py_CLEAR, Py_XDECREF do not fail if the
> the target is NULL) when a simple "return NULL" can do instead.
>

NAK. Scattering the cleanup code throughout the body of the function is an
excellent way of introducing resource leaks. The current code is more
readable and robust.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial-devel/attachments/20090831/db35427f/attachment.htm 


More information about the Mercurial-devel mailing list