]> git.ipfire.org Git - thirdparty/git.git/commit
parse_object(): simplify blob conditional
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 21 Nov 2022 19:26:55 +0000 (14:26 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Nov 2022 01:13:54 +0000 (10:13 +0900)
commit40286ca2fa1e08c386ea7bc6b76616a3cac63ffd
treece8f4f6cdab16cff74902780d997f5625a5ad226
parent8db2dad7a045e376b9c4f51ddd33da43c962e3a4
parse_object(): simplify blob conditional

Commit 8db2dad7a0 (parse_object(): check on-disk type of suspected blob,
2022-11-17) simplified the conditional for checking if we might have a
blob. But we can simplify it further. In:

  !obj || (obj && obj->type == OBJ_BLOB)

the short-circuit "OR" means "obj" will always be true on the right-hand
side. The compiler almost certainly optimized that out anyway, but
dropping it makes the conditional easier to understand for humans.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object.c