Skip to content

Commit 7b19314

Browse files
committed
fix getting locIdx
1 parent 9a7335f commit 7b19314

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pdata/pprofile/locations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ var errTooManyLocationTableEntries = errors.New("too many entries in LocationTab
2828
// PutLocation updates a LocationTable and a Profile's LocationIndices to
2929
// add or update a location.
3030
func PutLocation(table LocationSlice, record Profile, loc Location) error {
31-
for i := range record.LocationIndices().All() {
32-
idx := int(record.LocationIndices().At(i))
31+
for i, locIdx := range record.LocationIndices().All() {
32+
idx := int(locIdx)
3333
if idx < 0 || idx >= table.Len() {
3434
return fmt.Errorf("index value %d out of range in LocationIndices[%d]", idx, i)
3535
}

0 commit comments

Comments
 (0)