Subject: Re: [PATCH] oidmap.h: strongly discourage using OIDMAP_INIT directly

From: Junio C Hamano <[email-masked]>
Date: Fri, 22 Dec 2017 12:12:00 -0800

Brandon Williams <[email-masked]> writes:

>> -#define OIDMAP_INIT { { NULL } }
>> +/*
>> + * This macro initializes the data structure only incompletely, just enough
>> + * to call oidmap_get() on an empty map. Use oidmap_init() instead.
>> + */
>> +#define OIDMAP_INIT_INCOMPLETELY { { NULL } }
>
> This is one way of approaching the problem.  Couldn't we also take the
> approach like we have with oidset and ensure that when oidmap_get() or
> _put() are called that if the oidmap isn't initialized, we simply do
> that then?

Hmph.  Can you show how the alternative code would look like?