]> git.ipfire.org Git - thirdparty/git.git/commit
style: do not "break" in switch() after "return"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 15 Dec 2020 23:50:27 +0000 (00:50 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Dec 2020 00:32:50 +0000 (16:32 -0800)
commit56f56ac50b932310c629832fad256e624ca451e3
tree021707d7d8db0ffeb116c291298594d15d6c01ff
parent898f80736c75878acc02dc55672317fcc0e0a5a6
style: do not "break" in switch() after "return"

Remove this unreachable code. It was found by SunCC, it's found by a
non-fatal warning emitted by SunCC. It's one of the things it's more
vehement about than GCC & Clang.

It complains about a lot of other similarly unreachable code, e.g. a
BUG(...) without a "return", and a "return 0" after a long if/else,
both of whom have "return" statements. Those are also genuine
redundancies to a compiler, but arguably make the code a bit easier to
read & less fragile to maintain.

These return/break cases are just unnecessary however, and as seen
here the surrounding code just did a plain "return" without a "break"
already.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
apply.c
builtin/fast-export.c