From: Derrick Stolee via GitGitGadget Date: Tue, 10 Sep 2024 02:28:46 GMT Subject: [PATCH 21/30] pack-objects: extract should_attempt_deltas() Message-ID: <502008bb7c57327bad65867a70871ef0cf8898b5.1725935335.git.gitgitgadget@gmail.com> In-Reply-To: From: Derrick Stolee Signed-off-by: Derrick Stolee --- builtin/pack-objects.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 3d0bb33427d..b1d684c3417 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -3151,8 +3151,7 @@ static int should_attempt_deltas(struct object_entry *entry) */ return 0; - if (!entry->type_valid || - oe_size_less_than(&to_pack, entry, 50)) + if (!entry->type_valid || oe_size_less_than(&to_pack, entry, 50)) return 0; if (entry->no_try_delta) @@ -3162,14 +3161,12 @@ static int should_attempt_deltas(struct object_entry *entry) if (oe_type(entry) < 0) die(_("unable to get type of object %s"), oid_to_hex(&entry->idx.oid)); - } else { - if (oe_type(entry) < 0) { - /* - * This object is not found, but we - * don't have to include it anyway. - */ - return 0; - } + } else if (oe_type(entry) < 0) { + /* + * This object is not found, but we + * don't have to include it anyway. + */ + return 0; } return 1; -- gitgitgadget