Four patches against 2.3.14

Bron Gondwana brong at fastmail.fm
Fri Mar 27 07:46:58 EDT 2009


On Fri, Mar 27, 2009 at 10:07:29AM +0000, David Carter wrote:
> robust_squatter.patch
> =====================
>
> Don't give up if index_me() throws an error. Not wildly happy about
> mboxlist_findall which can run for several days in any case.

l->tail = l->tail->next = n;

Is that _guaranteed_ to evaluate correctly?  It looks like someone
being a smartarse to avoid writing:

l->tail->next = n;
l->tail = l->tail->next;

Or even:

tail = l->tail;
tail->next = n;
l->tail = n;

Which is ultra-extra clear about what you're doing.  It took me a
couple of seconds parsing to understand what you were doing with 
that line, and it scares me.  If the compiler re-optimised the
order in which it did the assignment and lookup, things would
get really sad.

(it's annoying re-inventing such a common wheel in the first
place really.  The bikeshed painter in me wonders why it's not
a realloced array, but that's more accounting and not worth
it for a one-shot piece of code)

Bron.


More information about the Cyrus-devel mailing list