Skip to content

Commit

Permalink
[chore] nit improvements to internal service.getBallastSize (#6790)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Dec 13, 2022
1 parent 1e6c7e5 commit 6a5ac5c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,10 @@ func (srv *Service) Logger() *zap.Logger {
}

func getBallastSize(host component.Host) uint64 {
var ballastSize uint64
extensions := host.GetExtensions()
for _, extension := range extensions {
if ext, ok := extension.(interface{ GetBallastSize() uint64 }); ok {
ballastSize = ext.GetBallastSize()
break
for _, ext := range host.GetExtensions() {
if bExt, ok := ext.(interface{ GetBallastSize() uint64 }); ok {
return bExt.GetBallastSize()
}
}
return ballastSize
return 0
}

0 comments on commit 6a5ac5c

Please sign in to comment.