Replace utils.Once with stdlib sync.OnceValue

This commit is contained in:
Kovid Goyal
2023-08-09 12:08:42 +05:30
parent 49ea26968c
commit 4f72bb9894
22 changed files with 53 additions and 96 deletions

View File

@@ -17,6 +17,7 @@ import (
"regexp"
"strconv"
"strings"
"sync"
"time"
"kitty/tools/cli"
@@ -780,7 +781,7 @@ func (self *Themes) Copy() *Themes {
return ans
}
var camel_case_pat = utils.Once(func() *regexp.Regexp {
var camel_case_pat = sync.OnceValue(func() *regexp.Regexp {
return regexp.MustCompile(`([a-z])([A-Z])`)
})