Null out on slice compaction. (#2503)

Go 1.22 does this automatically with `slices` - https://go.dev/blog/generic-slice-functions
This commit is contained in:
Raja Subramanian
2024-02-23 08:20:03 +05:30
committed by GitHub
parent 787af0e84c
commit 132d1ad31a
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -157,6 +157,7 @@ func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher(offer webrtc.Sess
for i, attr := range unmatchVideo.Attributes {
if strings.Contains(attr.Value, dd.ExtensionURI) {
unmatchVideo.Attributes[i] = unmatchVideo.Attributes[len(unmatchVideo.Attributes)-1]
unmatchVideo.Attributes[len(unmatchVideo.Attributes)-1] = sdp.Attribute{}
unmatchVideo.Attributes = unmatchVideo.Attributes[:len(unmatchVideo.Attributes)-1]
break
}