Skip to content

Commit 2de74a7

Browse files
committed
Consolidate for expressions
1 parent c98fb47 commit 2de74a7

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

pkg/model/gcemodel/autoscalinggroup.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,7 @@ func (b *AutoscalingGroupModelBuilder) splitToZones(ig *kops.InstanceGroup) (map
283283
totalSize += targetSizes[i]
284284
}
285285
i := 0
286-
for {
287-
if totalSize >= minSize {
288-
break
289-
}
286+
for totalSize < minSize {
290287
targetSizes[i]++
291288
totalSize++
292289

protokube/pkg/gossip/dns/hosts/hosts.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,7 @@ func UpdateHostsFileWithRecords(p string, mutator func(guarded []string) (*HostM
151151
}
152152

153153
// Ensure a single blank line
154-
for {
155-
if len(out) == 0 {
156-
break
157-
}
158-
154+
for len(out) > 0 {
159155
if out[len(out)-1] != "" {
160156
break
161157
}

0 commit comments

Comments
 (0)