From 4c7d20847447dbd93059158d375a260966d7d4c5 Mon Sep 17 00:00:00 2001 From: Yang Hau Date: Thu, 26 Dec 2024 12:17:16 +0100 Subject: [PATCH] refactor: Replace loop with native copy() --- mpd/mpd.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mpd/mpd.go b/mpd/mpd.go index 9972443..b21c507 100644 --- a/mpd/mpd.go +++ b/mpd/mpd.go @@ -201,9 +201,7 @@ func (as *AdaptationSet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) er } *as = AdaptationSet(n.wrappedAdaptationSet) as.ContentProtection = make([]ContentProtectioner, len(n.ContentProtection)) - for i := range n.ContentProtection { - as.ContentProtection[i] = n.ContentProtection[i] - } + copy(as.ContentProtection, n.ContentProtection) return nil }