Re: [PATCH v3] object-name: fix reversed ordering with ":/<PATTERN>" revisions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 06.12.24 um 16:45 schrieb Patrick Steinhardt:
> @@ -1423,7 +1423,7 @@ static int get_oid_oneline(struct repository *r,
>
>  	for (l = list; l; l = l->next) {
>  		l->item->object.flags |= ONELINE_SEEN;
> -		commit_list_insert(l->item, &copy);
> +		copy_tail = &commit_list_insert(l->item, copy_tail)->next;

OK.  The following does the same while being clearer:

		copy_tail = commit_list_append(l->item, copy_tail);

You could get the idea to do that replacement across the whole source
tree.  That would be nice, but must not be done blindly (e.g. with
Coccinelle), as the result will be different if the second argument
can point to somewhere in the middle of the list.  Here it's OK because
we indeed are appending (invariant *copy_tail == NULL holds).

René






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux