Re: [PATCH 04/11] unpack-trees: clean up some flow control
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Feb 24, 2023, 22:33 UTC
- Message-ID
- <20230224223313.1509428-1-jonathantanmy@google.com>
- In-Reply-To
- <f5a58123034a708b49aac7076197ad2ccdd3cba1.1677143700.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> * update_sparsity() has a check early on that will BUG() if > o->skip_sparse_checkout is set; as such, there's no need to check > for that condition again later in the code. We can simply remove > the check and its corresponding goto label.
[snip]
Show 6 quoted lines
> @@ -2113,8 +2115,6 @@ enum update_sparsity_result update_sparsity(struct unpack_trees_options *o) > memset(&pl, 0, sizeof(pl)); > free_pattern_list = 1; > populate_from_existing_patterns(o, &pl); > - if (o->skip_sparse_checkout) > - goto skip_sparse_checkout;
I've verified that indeed there is a prior check that o->skip_sparse_checkout is not set (not visible in the diff).
Up to here, everything looks good.