Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

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: #3004

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
  • Loading branch information
c3d authored and fidencio committed Nov 11, 2020
1 parent 7542405 commit f4dd729
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 @@ -375,11 +375,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 f4dd729

Please sign in to comment.