From: Junio C Hamano <gitster@pobox•com>
To: David Kastrup <dak@gnu•org>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 1/2] builtin/blame.c: struct blame_entry does not need a prev link
Date: Tue, 21 Jan 2014 13:54:58 -0800 [thread overview]
Message-ID: <xmqqlhy9t2z1.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1390157870-29795-2-git-send-email-dak@gnu.org> (David Kastrup's message of "Sun, 19 Jan 2014 19:57:49 +0100")
David Kastrup <dak@gnu•org> writes:
> ---
Thanks. At some point during its development I must have thought
that having it as a dual-linked list may make it easier when we have
to split a block into pieces, but it seems that split_overlap() does
not need to look at this information.
Needs sign-off.
> builtin/blame.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/builtin/blame.c b/builtin/blame.c
> index e44a6bb..2195595 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -197,7 +197,6 @@ static void drop_origin_blob(struct origin *o)
> * scoreboard structure, sorted by the target line number.
> */
> struct blame_entry {
> - struct blame_entry *prev;
> struct blame_entry *next;
>
> /* the first line of this group in the final image;
> @@ -282,8 +281,6 @@ static void coalesce(struct scoreboard *sb)
> ent->s_lno + ent->num_lines == next->s_lno) {
> ent->num_lines += next->num_lines;
> ent->next = next->next;
> - if (ent->next)
> - ent->next->prev = ent;
> origin_decref(next->suspect);
> free(next);
> ent->score = 0;
> @@ -534,7 +531,7 @@ static void add_blame_entry(struct scoreboard *sb, struct blame_entry *e)
> prev = ent;
>
> /* prev, if not NULL, is the last one that is below e */
> - e->prev = prev;
> +
> if (prev) {
> e->next = prev->next;
> prev->next = e;
> @@ -543,8 +540,6 @@ static void add_blame_entry(struct scoreboard *sb, struct blame_entry *e)
> e->next = sb->ent;
> sb->ent = e;
> }
> - if (e->next)
> - e->next->prev = e;
> }
>
> /*
> @@ -555,14 +550,12 @@ static void add_blame_entry(struct scoreboard *sb, struct blame_entry *e)
> */
> static void dup_entry(struct blame_entry *dst, struct blame_entry *src)
> {
> - struct blame_entry *p, *n;
> + struct blame_entry *n;
>
> - p = dst->prev;
> n = dst->next;
> origin_incref(src->suspect);
> origin_decref(dst->suspect);
> memcpy(dst, src, sizeof(*src));
> - dst->prev = p;
> dst->next = n;
> dst->score = 0;
> }
> @@ -2502,8 +2495,6 @@ parse_done:
> ent->suspect = o;
> ent->s_lno = bottom;
> ent->next = next;
> - if (next)
> - next->prev = ent;
> origin_incref(o);
> }
> origin_decref(o);
next prev parent reply other threads:[~2014-01-21 21:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-19 18:57 [PATCH 0/2] Two janitorial patches for builtin/blame.c David Kastrup
2014-01-19 18:57 ` [PATCH 1/2] builtin/blame.c: struct blame_entry does not need a prev link David Kastrup
2014-01-21 21:54 ` Junio C Hamano [this message]
2014-01-21 23:02 ` David Kastrup
2014-01-19 18:57 ` [PATCH 2/2] Eliminate same_suspect function in builtin/blame.c David Kastrup
2014-01-21 16:22 ` [PATCH 0/2] Two janitorial patches for builtin/blame.c David Kastrup
2014-01-21 16:55 ` Jonathan Nieder
2014-01-21 17:40 ` David Kastrup
2014-01-21 17:44 ` Jonathan Nieder
2014-01-21 17:58 ` David Kastrup
2014-01-21 19:15 ` Jonathan Nieder
2014-01-21 19:56 ` David Kastrup
2014-01-21 20:01 ` Jonathan Nieder
2014-01-21 21:30 ` David Kastrup
2014-01-21 20:20 ` Junio C Hamano
2014-01-21 22:56 ` David Kastrup
2014-01-21 19:53 ` Jonathan Nieder
-- strict thread matches above, loose matches on Subject: below --
2014-01-22 0:20 [PATCH 0/2] Two mostly " David Kastrup
2014-01-22 0:20 ` [PATCH 1/2] builtin/blame.c: struct blame_entry does not need a prev link David Kastrup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqlhy9t2z1.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=dak@gnu$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox