From: Felipe Contreras Date: Wed, 16 Dec 2020 21:25:02 GMT Subject: Re: [PATCH 1/3] merge-ort: copy a few small helper functions from merge-recursive.c Message-ID: <5fda7b2ee79df_8c35208e1@natae.notmuch> In-Reply-To: Junio C Hamano wrote: > Elijah Newren writes: > > > I wonder if a slightly different codeflow may be easier to follow > >> > >> struct commit_list *result = NULL; > >> while (list) { > >> struct commit_list *next = list->next; > >> list->next = result; > >> result = list; > >> list = next; > >> } > >> return result; > >> > >> if we were to try improving this for readability? > > > > Looks like Felipe also came up with the same version you did (modulo > > the temporary variable name). > > Funny if it was sent as a response to the message that already had > the same answer... It's two changes, actually: s/result/current/ and s/next/tmp/. But yeah, it's interesting that I used Elijahs's version as a basis and arrived at virtually the same thing. Cheers. -- Felipe Contreras