Re: [PATCH v3 17/32] submodule--helper: don't redundantly check "else if (res)"
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 21, 2022, 16:12 UTC
- Message-ID
- <CAPig+cTB_ei+VKfOtHRAkhCRgzqT=aPkq91DUtfXmjkRtg6FDw@mail.gmail.com>
- In-Reply-To
- <patch-v3-17.32-fa2417c7a17-20220821T130231Z-avarab@gmail.com>
On Sun, Aug 21, 2022 at 10:00 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 8 quoted lines
> The "res" variable must be true at this point in update_submodule(), > as just a few lines above this we've unconditionally: > > if (!res) > return 0; > > So we don't need to guard the "return 1" with an "else if (res)", we > an return unconditionally at this point. See b3c5f5cb048 (submodule:
s/an/can/
Show 5 quoted lines
> move core cmd_update() logic to C, 2022-03-15) for the initial > introduction of this code, this check of "res" has always been > redundant. > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>