From 3d8ce2ccc60ebd3e26a24ae5e673714a0dd4663d Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Fri, 15 May 2020 16:41:04 +0200 Subject: [PATCH] annotations: Simplify negative logic Replace strange negative logic (!ok -> continue) with positive logic (ok -> do it) Fixes: #3004 Signed-off-by: Christophe de Dinechin --- virtcontainers/pkg/oci/utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/virtcontainers/pkg/oci/utils.go b/virtcontainers/pkg/oci/utils.go index 27caee57fe..32d346f968 100644 --- a/virtcontainers/pkg/oci/utils.go +++ b/virtcontainers/pkg/oci/utils.go @@ -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