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

Re: [RFH] WTF did we change in git-fsck recently?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 21, 2007, 01:30 UTC
Message-ID
<alpine.LFD.0.98.0704201826350.9964@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.0.98.0704201823310.9964@woody.linux-foundation.org>
On Fri, 20 Apr 2007, Linus Torvalds wrote:
> 
> Hmm. Probably something broken in my "object decorator" thing then. 
Duh.

When I did the object decorator thing, I made the "loop over the hash" function use the same logic for updating the hash, ie made them use

	if (++j >= size)
		j = 0;
for both the hash update for both "insert" and "lookup"
HOWEVER.
For some inexplicable reason I had an extraneous
	j++;

in the insert path (probably just from the fact that the old code there used

	j++;
	if (j >= size)
		j = 0;

and when I made them use the same logic I just didn't remove the old extraneous line properly.

This fixes it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 decorate.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/decorate.c b/decorate.c
index 396b413..23f6b00 100644
--- a/decorate.c
+++ b/decorate.c
@@ -24,7 +24,6 @@ static void *insert_decoration(struct decoration *n, struct object *base, void *
 			hash[j].decoration = decoration;
 			return old;
 		}
-		j++;
 		if (++j >= size)
 			j = 0;
 	}
Previous: Linus TorvaldsNext: Junio C Hamano
Message 3 of 5 in “[RFH] WTF did we change in git-fsck recently?”
  1. Junio C HamanoApr 21, 2007
  2. Linus TorvaldsApr 21, 2007
  3. Linus TorvaldsApr 21, 2007
  4. Junio C HamanoApr 21, 2007
  5. Automated bisect success storyJunio C Hamano, Apr 21, 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.