From: Jeff King Date: Wed, 13 May 2020 20:17:24 GMT Subject: Re: [PATCH 3/8] commit-graph.c: peel refs in 'add_ref_to_set' Message-ID: <20200513201724.GA1823254@coredump.intra.peff.net> In-Reply-To: <20200513194848.GA24173@syl.local> On Wed, May 13, 2020 at 01:48:48PM -0600, Taylor Blau wrote: > > Alternatively, you could do this without a struct copy at all with: > > > > if (!peel_ref(...)) > > oid = peeled; > > oidset_insert(..., oid); > > > > which is actually a bit cheaper. > > Makes sense, I think this version is the better of the two that you > suggested here. I noticed one small thing which is that since peeled is > only on the stack, I think we actually want 'oid = &peeled', but > otherwise I took this as-is. Yes, definitely. That's what I get for writing code in my email editor. :) -Peff