Thread (8 messages) flat view 8 messages, 3 authors, 2016-06-15

Re: [PATCH 1/4] Start to replace locate_rename_dst() with a generic function.

From: Yann Dirson <hidden>
Date: 2016-06-15 22:49:58

On Thu, Nov 04, 2010 at 03:45:55PM -0500, Jonathan Nieder wrote:
 static struct diff_rename_dst *locate_rename_dst(struct diff_filespec *two,
						  insert_ok)
 {
	return locate_element(&rename_dst_nr, &rename_dst_alloc, elem, insert_ok);
 }
The idea was to deprecate locate_rename_dst() itself and only use
locate_element()...
takes more advantage of the compiler's typechecking and looks easy
enough to read.
... but typechecking was something that was worrying me here.  Looks
like a good idea, after all.

Since this is local to diffcore-rename, I don't mind the locate_element()
name, but if this is to be used more widely I think it would need to be
named more precisely.  (find_or_insert_in_array()?)
Yes - that's just a prototype.
I guess these parentheses came from search+replace?  It's more
readable without them.
Right, many of them are superfluous.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help