Skip to content

Commit

Permalink
chore: simplify filling values
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 13, 2023
1 parent 85e2d70 commit 2ebd09e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions charger/eebus.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,9 @@ func (c *EEBus) currents() (float64, float64, float64, error) {
return 0, 0, 0, err
}

count := len(currents)
if count < 3 {
for fill := 0; fill < 3-count; fill++ {
currents = append(currents, 0)
}
// fill phases
for i := len(currents); i < 3; i++ {
currents = append(currents, 0)
}

return currents[0], currents[1], currents[2], nil
Expand Down

0 comments on commit 2ebd09e

Please sign in to comment.