]> git.proxmox.com Git - mirror_edk2.git/commit
SecurityPkg/DxeImageVerificationHandler: remove "else" after return/break
authorLaszlo Ersek <lersek@redhat.com>
Thu, 16 Jan 2020 10:44:09 +0000 (11:44 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 31 Jan 2020 09:35:31 +0000 (09:35 +0000)
commiteccb856f013aec700234211e7371f03454ef9d52
treea7ef6307d3d6bc64d2c0c8894d4e65d0831a5297
parent1e0f973b65c34841288c25fd441a37eec8a30ac7
SecurityPkg/DxeImageVerificationHandler: remove "else" after return/break

In the code structure

  if (condition) {
    //
    // block1
    //
    return;
  } else {
    //
    // block2
    //
  }

nesting "block2" in an "else" branch is superfluous, and harms
readability. It can be transformed to:

  if (condition) {
    //
    // block1
    //
    return;
  }
  //
  // block2
  //

with identical behavior, and improved readability (less nesting).

The same applies to "break" (instead of "return") in a loop body.

Perform these transformations on DxeImageVerificationHandler().

This patch is a no-op for behavior. Use

  git show -b -W

for reviewing it more easily.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2129
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200116190705.18816-3-lersek@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
[lersek@redhat.com: push with Mike's R-b due to Chinese New Year
 Holiday: <https://edk2.groups.io/g/devel/message/53429>; msgid
 <d3fbb76dabed4e1987c512c328c82810@intel.com>]
SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c