refactor: use the built-in max/min to simplify the code

Signed-off-by: yingshanghuangqiao <yingshanghuangqiao@foxmail.com>
This commit is contained in:
yingshanghuangqiao
2025-08-01 14:59:34 +02:00
committed by Márk Sági-Kazár
parent b7b990446f
commit 4df8a66f9e
+1 -4
View File
@@ -174,10 +174,7 @@ func parseSizeInBytes(sizeStr string) uint {
}
}
size := cast.ToInt(sizeStr)
if size < 0 {
size = 0
}
size := max(cast.ToInt(sizeStr), 0)
return safeMul(uint(size), multiplier)
}