Re: gitk problems: can't unset "idinlist(...)"
- From
Jeff King <peff@peff.net>
- Date
- Jul 21, 2007, 06:24 UTC
- Message-ID
- <20070721062448.GA8722@coredump.intra.peff.net>
- In-Reply-To
- <20070721061857.GB29820@coredump.intra.peff.net>
On Sat, Jul 21, 2007 at 02:18:57AM -0400, Jeff King wrote:
> correct to me (though there are some unrelated formatting changes which > made it a little harder to read).
By which I mean you can keep the 'for' loop, since in either case we are always reading p->next (if we skip, then we set *pp to p->next anyway, and if we don't, then pp becomes a pointer to p->next).
So this is a more readable patch which I believe is equivalent.
---
diff --git a/revision.c b/revision.c index 28b5f2e..7def867 100644 --- a/revision.c +++ b/revision.c @@ -1329,10 +1329,11 @@ static void remove_duplicate_parents(struct commit *commit) /* Examine existing parents while marking ones we have seen... */ for (p = commit->parents; p; p = p->next) { struct commit *parent = p->item; - if (parent->object.flags & TMP_MARK) + if (parent->object.flags & TMP_MARK) { + *pp = p->next; continue; + } parent->object.flags |= TMP_MARK; - *pp = p; pp = &p->next; } /* ... and clear the temporary mark */