Re: [RFCv2 05/16] remote.h: Change get_remote_heads return to void
- From
Stefan Beller <sbeller@google.com>
- Date
- Jun 2, 2015, 21:25 UTC
- Message-ID
- <CAGZ79kbuwT_Wd099fys7Dz8y3ckC7pXk-qV4xe=1w4rXhMwRQg@mail.gmail.com>
- In-Reply-To
- <xmqqlhg124ji.fsf@gitster.dls.corp.google.com>
On Tue, Jun 2, 2015 at 2:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Stefan Beller <sbeller@google.com> writes: > >> No function uses the return value of get_remote_heads, so we don't want >> to confuse readers by it. >> >> Signed-off-by: Stefan Beller <sbeller@google.com> >> --- > > This is somewhat a sad change, as the returned value is designed to > be useful if caller wants to continue appending to the list.
But there are no callers since like 2005. ;) (I did not exactly track it down, but even the last caller went away rather fast)
> > Does it really "confuse" readers enough that it hurts to have a > return value? >
Probably no. But I think this is just carrying around cruft we could avoid?
> > Now such a caller has to tangle the list (the variable it gave the > function as the fourth argument) itself to find its tail.
So you're saying if someone in the future really wants to append to that list, they don't find out to just return it again but rather do an O(n) operation?