Re: [PATCH 1/8] fixup! combine_diff: simplify intersect_paths() further
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 3, 2014, 19:40 UTC
- Message-ID
- <xmqqy51sdly5.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <60ec61bdd2ef3cba7537e29c42f9c8a810da245d.1391430523.git.kirr@mns.spb.ru>
Kirill Smelkov <kirr@mns.spb.ru> writes:
Show 18 quoted lines
> That cleanup patch is good, but I've found a bug in it. In the item removal > code > >> + /* p->path not in q->queue[]; drop it */ >> + struct combine_diff_path *next = p->next; >> + >> + if ((*tail = next) != NULL) >> + tail = &next->next; >> + free(p); >> continue; > > *tail = next > > is right, but > > tail = &next->next > > is wrong,
Heh, surely. We just have skipped, and the fact that tail points at the pointer variable that points at the first of the remaining items does not change with this skipping of next by assigning it to *tail. An extra assignment to tail will skip one more, which is unnecessary.