Re: [PATCH] Make git-fmt-merge-msg a builtin

From: Timo Hirvonen <tihirvon@gmail.com>
Date: 2006-07-04 01:26:21
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

> I had in mind that I want to use path-list instead (which is cooking in 
> the merge-recursive efforts ATM). And there, I would add a flag 
> needs_payload. Opinions?

This code is so simple that making the path_list more complex
(needs_payload special case?) is not worth it.  I have not looked at the
code very closely though and have no idea what I'm talking about :)

> > > +static void free_list(struct list *list)
> > > +{
> > > +	int i;
> > > +
> > > +	if (list->alloc == 0)
> > > +		return;
> > 
> > Unnecessary if nr is 0 too.
> 
> No. If nr == 0, alloc need not be 0, and if it is not, list and payload 
> are still allocated.

If alloc is 0 then nr is 0 too (at least it _should_ be).  The code would
effectively become:

	for (i = 0; i < 0; i++) {
		...
	}
	free(NULL);
	free(NULL);
	list->nr = list->alloc = 0;

But this is not important...

> > free(NULL) is safe.
> 
> Is it? I vaguely remember that I had problems with this on some obscure 
> platform.

I don't think so.

-- 
http://onion.dynserv.net/~timo/
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Jul 04 01:26:57 2006

This archive was generated by hypermail 2.1.8 : 2006-07-04 01:27:23 EST