Skip to content

Commit

Permalink
Remove unnecessary break on switch case
Browse files Browse the repository at this point in the history
  • Loading branch information
albertusdev committed Jul 22, 2019
1 parent df6feb0 commit b53fa6d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
5 changes: 1 addition & 4 deletions pkg/metrics/statsd_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type StatsdCollectorConfig struct {
Prefix string
// StatsdSampleRate sets statsd sampling. If 0, defaults to 1.0. (no sampling)
SampleRate float32
// FlushBytes sets message size for statsd packets. If 0, defaults to LANFlushSize.
// FlushBytes sets message size for statsd packets. If 0, defaults to LANFlushSize.
FlushBytes int
}

Expand Down Expand Up @@ -73,13 +73,10 @@ func Update(updateOption UpdateOption) {
switch updateOption.Type {
case Duration:
err = instance.client.TimingDuration(formatter(updateOption), updateOption.Duration, instance.sampleRate)
break
case Gauge:
err = instance.client.Gauge(formatter(updateOption), int64(updateOption.NumValue), instance.sampleRate)
break
case Count:
err = instance.client.Inc(formatter(updateOption), 1, instance.sampleRate)
break
}
if err != nil {
logger.Errorf("metrics.Update got an error: %s", err)
Expand Down
10 changes: 0 additions & 10 deletions pkg/processor/native/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,34 +84,24 @@ func getStartingPointForCrop(w, h, rw, rh int, cropPoint processor.CropPoint) (i
switch cropPoint {
case processor.CropTop:
y = 0
break
case processor.CropTopLeft:
x = 0
y = 0
break
case processor.CropTopRight:
x = w - rw
y = 0
break
case processor.CropLeft:
x = 0
break
case processor.CropRight:
x = w - rw
break
case processor.CropBottom:
y = h - rh
break
case processor.CropBottomLeft:
x = 0
y = h - rh
break
case processor.CropBottomRight:
x = w - rw
y = h - rh
break
default:
break
}
return x, y
}

0 comments on commit b53fa6d

Please sign in to comment.