git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
YDYann Dirson <ydirson@free.fr>
Date
Nov 4, 2010, 21:22 UTC
Message-ID
<20101104212204.GC8911@home.lan>
In-Reply-To
<20101104204555.GA18187@burratino>
On Thu, Nov 04, 2010 at 03:45:55PM -0500, Jonathan Nieder wrote:
Show 5 quoted lines
>  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.
Previous: Jonathan NiederNext: Yann Dirson
Message 4 of 8 in “generalizing sorted-array handling”
  1. generalizing sorted-array handlingYann Dirson, Nov 4, 2010
  2. 1/4 Start to replace locate_rename_dst() with a generic function.Yann Dirson, Nov 4, 2010
  3. Jonathan NiederNov 4, 2010
  4. Yann DirsonNov 4, 2010
  5. 2/4 Abstract _locate_element() some more with elem_size parameter.Yann Dirson, Nov 4, 2010
  6. 3/4 Introduce "abstract class" to make _locate_element() more independant of diff_rename_dst.Yann Dirson, Nov 4, 2010
  7. Jonathan NiederNov 4, 2010
  8. 4/4 Remove remaining rename_dst references in _locate_element() and pass a pointer to it.Yann Dirson, Nov 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.