mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
Bump go version to 1.21
Allows us to use the much faster builtin min/max functions for two variable min/max
This commit is contained in:
parent
f125ffe3e0
commit
49ea26968c
17 changed files with 44 additions and 53 deletions
|
|
@ -30,7 +30,7 @@ func ParseStrDict(val, record_sep, field_sep string) (map[string]string, error)
|
|||
func PositiveFloat(val string) (ans float64, err error) {
|
||||
ans, err = strconv.ParseFloat(val, 64)
|
||||
if err == nil {
|
||||
ans = utils.Max(0, ans)
|
||||
ans = max(0, ans)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ func PositiveFloat(val string) (ans float64, err error) {
|
|||
func UnitFloat(val string) (ans float64, err error) {
|
||||
ans, err = strconv.ParseFloat(val, 64)
|
||||
if err == nil {
|
||||
ans = utils.Max(0, utils.Min(ans, 1))
|
||||
ans = max(0, min(ans, 1))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue