Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 8, 2024. It is now read-only.
/m3u8Public archive

Commitdb489ea

Browse files
committed
use map[]struct{} instead of map[]bool for altsWritten as set implementation;
1 parent180dc61 commitdb489ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎writer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ func (p *MasterPlaylist) Encode() *bytes.Buffer {
9393
}
9494
}
9595

96-
varaltsWritten=make(map[string]bool)
96+
varaltsWritten=make(map[string]struct{})
9797

9898
for_,pl:=rangep.Variants {
9999
ifpl.Alternatives!=nil {
100100
for_,alt:=rangepl.Alternatives {
101101
// Make sure that we only write out an alternative once
102102
altKey:=fmt.Sprintf("%s-%s-%s-%s-%s",alt.Type,alt.GroupId,alt.Name,alt.Language,alt.URI)
103-
ifaltsWritten[altKey] {
103+
if_,alreadyWritten:=altsWritten[altKey];alreadyWritten {
104104
continue
105105
}
106-
altsWritten[altKey]=true
106+
altsWritten[altKey]=struct{}{}
107107

108108
p.buf.WriteString("#EXT-X-MEDIA:")
109109
ifalt.Type!="" {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp