Skip to content

Commit

Permalink
removed unnecessary once
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFireMike committed Jan 27, 2021
1 parent 39fa622 commit 4b0f966
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/communicator/device_class_group_properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/rs/zerolog/log"
"strconv"
"strings"
"sync"
)

type groupPropertyReader interface {
Expand Down Expand Up @@ -72,11 +71,12 @@ func (s *snmpGroupPropertyReader) getProperty(ctx context.Context) ([]map[string
size := len(networkInterfaces)
for i := 0; i < size; i++ {
var smallestIndex int
once := sync.Once{}
firstRun := true
for index := range networkInterfaces {
once.Do(func() {
if firstRun {
smallestIndex = index
})
firstRun = false
}
if index < smallestIndex {
smallestIndex = index
}
Expand Down

0 comments on commit 4b0f966

Please sign in to comment.