From: Ævar Arnfjörð Bjarmason Date: Tue, 15 Feb 2022 22:02:47 GMT Subject: Re: [PATCH v2 4/9] submodule: inline submodule_commits() into caller Message-ID: <220215.86iltfwztv.gmgdl@evledraar.gmail.com> In-Reply-To: <20220215172318.73533-5-chooglen@google.com> On Wed, Feb 16 2022, Glen Choo wrote: > - commits = submodule_commits(changed, name); > - oid_array_append(commits, &p->two->oid); > + item = string_list_insert(changed, name); > + if (!item->util) > + /* NEEDSWORK: should we have oid_array_init()? */ > + item->util = xcalloc(1, sizeof(struct oid_array)); > + oid_array_append(item->util, &p->two->oid); > } > } Yes, just adding it while we're at it seems worthwhile, and if not defining this in terms of the macro would be better, as the two are guaranteed not to drift apart. I.e. the pattern seen in: git grep -W 'memcpy.*&blank'