Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
Cleaning up logic
  • Loading branch information
stephanrotolante committed Apr 12, 2024
1 parent 971e403 commit 118ce7a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions sdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,8 @@ func extractFingerprint(desc *sdp.SessionDescription) (string, string, error) {

isBundled := strings.Contains(groupAttribue, "BUNDLE")

for _, m := range fingerprints {
if m != fingerprints[0] && !isBundled {
if !isBundled {
if len(fingerprints) != 1 {
return "", "", ErrSessionDescriptionConflictingFingerprints
}
}
Expand Down Expand Up @@ -779,14 +779,11 @@ func extractICEDetails(desc *sdp.SessionDescription, log logging.LeveledLogger)

isBundled := strings.Contains(groupAttribue, "BUNDLE")

for _, m := range remoteUfrags {
if m != remoteUfrags[0] && !isBundled {
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
}
}
if !isBundled {

Check failure on line 782 in sdp.go

View workflow job for this annotation

GitHub Actions / lint / Go

unnecessary leading newline (whitespace)

Check failure on line 783 in sdp.go

View workflow job for this annotation

GitHub Actions / lint / Go

File is not `gofumpt`-ed (gofumpt)
for _, m := range remotePwds {
if m != remotePwds[0] && !isBundled {
if len(remoteUfrags) != 1 {
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
} else if len(remotePwds) != 1 {
return "", "", nil, ErrSessionDescriptionConflictingIcePwd
}
}
Expand Down

0 comments on commit 118ce7a

Please sign in to comment.