builtin/blame.c: struct blame_entry does not need a prev link
Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Kastrup committed
Jan 22, 2014 at 01:20 UTC
a0f58c5830ac6d9e4da009f0273b1421588dc440
1 file changed
+2
-11
builtin/blame.c
+2
-11
@@ -197,7 +197,6 @@ static void drop_origin_blob(struct origin *o)
197
* scoreboard structure, sorted by the target line number.
198
*/
199
struct blame_entry {
200
- struct blame_entry *prev;
200
struct blame_entry *next;
201
202
/* the first line of this group in the final image;
@@ -282,8 +281,6 @@ static void coalesce(struct scoreboard *sb)
281
ent->s_lno + ent->num_lines == next->s_lno) {
282
ent->num_lines += next->num_lines;
283
ent->next = next->next;
285
- if (ent->next)
286
- ent->next->prev = ent;
284
origin_decref(next->suspect);
285
free(next);
286
ent->score = 0;
@@ -534,7 +531,7 @@ static void add_blame_entry(struct scoreboard *sb, struct blame_entry *e)
531
prev = ent;
532
533
/* prev, if not NULL, is the last one that is below e */
537
- e->prev = prev;
534
+
535
if (prev) {
536
e->next = prev->next;
537
prev->next = e;
@@ -543,8 +540,6 @@ static void add_blame_entry(struct scoreboard *sb, struct blame_entry *e)
540
e->next = sb->ent;
541
sb->ent = e;
542
}
546
- if (e->next)
547
- e->next->prev = e;
543
}
544
545
/*
@@ -555,14 +550,12 @@ static void add_blame_entry(struct scoreboard *sb, struct blame_entry *e)
550
*/
551
static void dup_entry(struct blame_entry *dst, struct blame_entry *src)
552
{
558
- struct blame_entry *p, *n;
553
+ struct blame_entry *n;
554
560
- p = dst->prev;
555
n = dst->next;
556
origin_incref(src->suspect);
557
origin_decref(dst->suspect);
558
memcpy(dst, src, sizeof(*src));
565
- dst->prev = p;
559
dst->next = n;
560
dst->score = 0;
561
}
@@ -2502,8 +2495,6 @@ parse_done:
2495
ent->suspect = o;
2496
ent->s_lno = bottom;
2497
ent->next = next;
2505
- if (next)
2506
- next->prev = ent;
2498
origin_incref(o);
2499
}
2500
origin_decref(o);