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

Re: [PATCH, take 1] Linear-time/space rename logic (exact renames only)

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
Oct 22, 2007, 07:07 UTC
Message-ID
<20071022070750.GM1179MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<alpine.LFD.0.999.0710211603200.10525@woody.linux-foundation.org>
On Sun, Oct 21, 2007 at 04:59:03PM -0700, Linus Torvalds wrote:
Show 17 quoted lines
> +static int find_same_files(void *ptr)
> +{
> +	struct file_similarity *p = ptr;
> +	struct file_similarity *src = NULL, *dst = NULL;
> +
> +	/* Split the hash list up into sources and destinations */
> +	do {
> +		struct file_similarity *entry = p;
> +		p = p->next;
> +		if (entry->src_dst < 0) {
> +			entry->next = src;
> +			src = entry;
> +		} else {
> +			entry->next = dst;
> +			dst = entry;
> +		}
> +	} while (p);

Aren't you truncating the ptr list after the first entry here? (While you still need the whole list in free_file_table.)

skimo
Previous: Jeff KingNext: Jeff King
Message 5 of 13 in “Linear-time/space rename logic (exact renames only)”
  1. Linear-time/space rename logic (exact renames only)Linus Torvalds, Oct 21, 2007
  2. David SymondsOct 22, 2007
  3. Linus TorvaldsOct 22, 2007
  4. Jeff KingOct 22, 2007
  5. Sven VerdoolaegeOct 22, 2007
  6. Jeff KingOct 22, 2007
  7. Linus TorvaldsOct 22, 2007
  8. Linear-time/space rename logic (exact renames only)Linus Torvalds, Oct 22, 2007
  9. Linus TorvaldsOct 22, 2007
  10. Linus TorvaldsOct 22, 2007
  11. Alex RiesenOct 22, 2007
  12. Linus TorvaldsOct 22, 2007
  13. Alex RiesenOct 22, 2007

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.