On 8/3/2022 2:31 AM, Junio C Hamano wrote: > "Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > >> From: Derrick Stolee <derrickstolee@xxxxxxxxxx> >> + for (i = 0; i < NAMESPACE__COUNT; i++) { >> + struct ref_namespace_info *info = &ref_namespaces[i]; >> + >> + if (!info->decoration) >> + continue; >> + if (info->exact) { >> + if (!strcmp(refname, info->ref)) { >> + deco_type = info->decoration; >> + break; >> + } >> + } else if (starts_with(refname, info->ref)) { >> + deco_type = info->decoration; >> + break; >> + } >> + } > > Very nice. The double-dash in the NAMESPACE__COUNT constant somehow > looks strange. As we scan through ref_namespace[] array densely, > > for (i = 0; i < ARRAY_SIZE(ref_namespace); i++) > ... > > without having to use the constant would probably be more in line > with the way how the rest of the codebase works. Ah, I did not know about that trick. Thanks! -Stolee