Re: [PATCH 1/5] refs: store submodule ref stores in a hashmap
- From
Stefan Beller <sbeller@google.com>
- Date
- Feb 9, 2017, 16:58 UTC
- Message-ID
- <CAGZ79kau2bYs7zegEiacAdbhn1LyOfAH9__rePfbQkX2iLgmMQ@mail.gmail.com>
- In-Reply-To
- <a944446c4c374125082f5ad8b79e731704b66196.1486629195.git.mhagger@alum.mit.edu>
> @@ -1402,17 +1435,17 @@ struct ref_store *ref_store_init(const char *submodule)
>
> struct ref_store *lookup_ref_store(const char *submodule)
> {> + if (!submodule_ref_stores.tablesize) > + hashmap_init(&submodule_ref_stores, submodule_hash_cmp, 20);
So we can lookup a submodule even before we initialized the subsystem? Does that actually happen? (It sounds like a bug to me.)
Instead of initializing, you could return NULL directly here.
Otherwise looks good.
Thanks, Stefan