psi: using copy inside UpdateLocation() instead of range

This commit is contained in:
saxon 2019-01-07 16:16:53 +10:30
parent 0d3abd5798
commit 261118187b
1 changed files with 1 additions and 3 deletions

View File

@ -114,9 +114,7 @@ func UpdateLocation(d []byte, s string) error {
return errors.New("pmt does not location descriptor, cannot update")
}
gb := LocationStrBytes(s)
for i := range d[locationDataIndx : locationDataIndx+locationDataSize] {
d[i+locationDataIndx] = gb[i]
}
copy(d[locationDataIndx:locationDataIndx+locationDataSize], gb)
d = updateCrc(d)
return nil
}