Re: [PATCH 3/4] odb: drop `loaded_alternates` field

Justin Tobler <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <anufdy4UAqoLWPgG@denethor>
On 26/08/10 03:33PM, Patrick Steinhardt wrote:
> The `struct object_database::loaded_alternates` field tells us whether
> or not alternates have been loaded already. This field was useful before
> the preceding commit as we were indeed lazy-loading alternates. But now
> that we started to eagerly load them we can assume them to be loaded
> after `odb_new()`, and hence the field does not serve any purpose
> anymore.

Now that alternates are eagerly set up, it is safe to assume, if we have
an ODB, the alternates have been loaded. Makes sense.

> Remove it.
> 
> Signed-off-by: Patrick Steinhardt <[email protected]>
> ---
[snip]
> @@ -1132,7 +1126,6 @@ void odb_prepare(struct object_database *o, enum odb_prepare_flags flags)
>  	 * the lifetime of the process.
>  	 */
>  	if (flags & ODB_PREPARE_FLUSH_CACHES) {
> -		o->loaded_alternates = 0;
>  		odb_prepare_alternates(o);

Also nice to see this go away as I thought it was little bit awkward to
unset it just to allow the us to reprepare the alternates.

-Justin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.