mirror of https://bitbucket.org/ausocean/av.git
psi: using copy inside UpdateLocation() instead of range
This commit is contained in:
parent
0d3abd5798
commit
261118187b
|
@ -114,9 +114,7 @@ func UpdateLocation(d []byte, s string) error {
|
||||||
return errors.New("pmt does not location descriptor, cannot update")
|
return errors.New("pmt does not location descriptor, cannot update")
|
||||||
}
|
}
|
||||||
gb := LocationStrBytes(s)
|
gb := LocationStrBytes(s)
|
||||||
for i := range d[locationDataIndx : locationDataIndx+locationDataSize] {
|
copy(d[locationDataIndx:locationDataIndx+locationDataSize], gb)
|
||||||
d[i+locationDataIndx] = gb[i]
|
|
||||||
}
|
|
||||||
d = updateCrc(d)
|
d = updateCrc(d)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue