mirror of
https://github.com/pion/mediadevices.git
synced 2025-10-05 16:46:51 +08:00
Apply go modernize (#650)
This commit is contained in:
@@ -3,6 +3,7 @@ package prop
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"slices"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -53,10 +54,8 @@ type IntOneOf []int
|
||||
|
||||
// Compare implements IntConstraint.
|
||||
func (i IntOneOf) Compare(a int) (float64, bool) {
|
||||
for _, ii := range i {
|
||||
if ii == a {
|
||||
return 0.0, true
|
||||
}
|
||||
if slices.Contains(i, a) {
|
||||
return 0.0, true
|
||||
}
|
||||
return 1.0, false
|
||||
}
|
||||
|
Reference in New Issue
Block a user