From 261118187b84f35dd0726b8fd2754cfb59bf2d91 Mon Sep 17 00:00:00 2001 From: saxon Date: Mon, 7 Jan 2019 16:16:53 +1030 Subject: [PATCH] psi: using copy inside UpdateLocation() instead of range --- stream/mts/psi/helpers.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stream/mts/psi/helpers.go b/stream/mts/psi/helpers.go index 9a4bb849..3448a0eb 100644 --- a/stream/mts/psi/helpers.go +++ b/stream/mts/psi/helpers.go @@ -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 }