fix: bug lint

This commit is contained in:
zarazaex69
2026-05-06 22:39:33 +03:00
parent aa49808e68
commit 2907bf9a85
+7 -7
View File
@@ -125,8 +125,8 @@ func SetVP8Options(fps, batchSize int) {
mu.Lock()
defer mu.Unlock()
ensureDefaultConfigLocked()
defaults.vp8FPS = clamp(fps, 120)
defaults.vp8BatchSize = clamp(batchSize, 64)
defaults.vp8FPS = clamp(fps, 1, 120)
defaults.vp8BatchSize = clamp(batchSize, 1, 64)
}
// SetDebug enables or disables verbose logging.
@@ -227,8 +227,8 @@ func Check(
"",
0,
0,
clamp(vp8FPS, 120),
clamp(vp8BatchSize, 64),
clamp(vp8FPS, 1, 120),
clamp(vp8BatchSize, 1, 64),
)
}()
@@ -479,9 +479,9 @@ func buildRoomURL(carrierName, roomID string) string {
}
}
func clamp(value, maxValue int) int {
if value < 1 {
return 1
func clamp(value, minValue, maxValue int) int {
if value < minValue {
return minValue
}
if value > maxValue {
return maxValue