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

Commit 3d8ce2c

Browse files
c3dfidencio
authored andcommitted
annotations: Simplify negative logic
Replace strange negative logic (!ok -> continue) with positive logic (ok -> do it) Fixes: #3004 Signed-off-by: Christophe de Dinechin <[email protected]>
1 parent 562a028 commit 3d8ce2c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

virtcontainers/pkg/oci/utils.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,9 @@ func addAssetAnnotations(ocispec specs.Spec, config *vc.SandboxConfig) error {
372372

373373
for _, a := range assetAnnotations {
374374
value, ok := ocispec.Annotations[a]
375-
if !ok {
376-
continue
375+
if ok {
376+
config.Annotations[a] = value
377377
}
378-
379-
config.Annotations[a] = value
380378
}
381379

382380
return nil

0 commit comments

Comments
 (0)