From 9e7659dcc2c362e755f95dd4dc69068820a24329 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Fri, 13 Nov 2020 05:28:11 -0800 Subject: [PATCH] nomad/structs: fix noop breaks (#9348) --- nomad/structs/diff.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nomad/structs/diff.go b/nomad/structs/diff.go index 6cb2fc0dc..e2160341f 100644 --- a/nomad/structs/diff.go +++ b/nomad/structs/diff.go @@ -1434,11 +1434,12 @@ func multiregionRegionDiff(r, other *MultiregionRegion, contextual bool) *Object sort.Sort(FieldDiffs(diff.Fields)) var added, deleted, edited bool +Loop: for _, f := range diff.Fields { switch f.Type { case DiffTypeEdited: edited = true - break + break Loop case DiffTypeDeleted: deleted = true case DiffTypeAdded: @@ -1990,11 +1991,12 @@ func primitiveObjectDiff(old, new interface{}, filter []string, name string, con diff.Fields = fieldDiffs(oldPrimitiveFlat, newPrimitiveFlat, contextual) var added, deleted, edited bool +Loop: for _, f := range diff.Fields { switch f.Type { case DiffTypeEdited: edited = true - break + break Loop case DiffTypeDeleted: deleted = true case DiffTypeAdded: