Skip to content

Commit

Permalink
annotations: Simplify negative logic
Browse files Browse the repository at this point in the history
Replace strange negative logic  (!ok -> continue) with positive
logic (ok -> do it)

Fixes: kata-containers#3004

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
  • Loading branch information
c3d authored and fidencio committed Nov 11, 2020
1 parent 562a028 commit 3d8ce2c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions virtcontainers/pkg/oci/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,9 @@ func addAssetAnnotations(ocispec specs.Spec, config *vc.SandboxConfig) error {

for _, a := range assetAnnotations {
value, ok := ocispec.Annotations[a]
if !ok {
continue
if ok {
config.Annotations[a] = value
}

config.Annotations[a] = value
}

return nil
Expand Down

0 comments on commit 3d8ce2c

Please sign in to comment.