Merge pull request #422 from svanharmelen/f-shaving-off-some-cpu-cycles
helper/schema: Shaving off some unneeded calls, saving CPU cycles
This commit is contained in:
commit
428cce2478
|
@ -349,12 +349,10 @@ func (d *ResourceData) getSet(
|
|||
var indexMap map[int]int
|
||||
if len(parts) > 0 {
|
||||
indexMap = make(map[int]int)
|
||||
}
|
||||
|
||||
// Build the set from all the items using the given hash code
|
||||
for i, v := range list {
|
||||
code := s.add(v)
|
||||
if indexMap != nil {
|
||||
// Build the set from all the items using the given hash code
|
||||
for i, v := range list {
|
||||
code := s.add(v)
|
||||
indexMap[code] = i
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue