mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 07:52:24 -05:00
update gruf / {go-cache, go-maps, go-kv} (#3361)
This commit is contained in:
parent
58af95a1d5
commit
2f582e2e33
7 changed files with 31 additions and 36 deletions
6
vendor/codeberg.org/gruf/go-kv/format/format.go
generated
vendored
6
vendor/codeberg.org/gruf/go-kv/format/format.go
generated
vendored
|
|
@ -197,7 +197,8 @@ func (f format) AppendBytes(b []byte) {
|
|||
|
||||
// Quoted only if spaces/requires escaping
|
||||
case f.Key():
|
||||
f.AppendStringSafe(b2s(b))
|
||||
s := byteutil.B2S(b)
|
||||
f.AppendStringSafe(s)
|
||||
|
||||
// Append as separate ASCII quoted bytes in slice
|
||||
case f.Verbose():
|
||||
|
|
@ -214,7 +215,8 @@ func (f format) AppendBytes(b []byte) {
|
|||
|
||||
// Quoted only if spaces/requires escaping
|
||||
case f.Value():
|
||||
f.AppendStringSafe(b2s(b))
|
||||
s := byteutil.B2S(b)
|
||||
f.AppendStringSafe(s)
|
||||
|
||||
// Append as raw bytes
|
||||
default:
|
||||
|
|
|
|||
5
vendor/codeberg.org/gruf/go-kv/format/util.go
generated
vendored
5
vendor/codeberg.org/gruf/go-kv/format/util.go
generated
vendored
|
|
@ -98,8 +98,3 @@ func isNil(i interface{}) bool {
|
|||
type eface struct{ _type, data unsafe.Pointer } //nolint
|
||||
return (*(*eface)(unsafe.Pointer(&i))).data == nil //nolint
|
||||
}
|
||||
|
||||
// b2s converts a byteslice to string without allocation.
|
||||
func b2s(b []byte) string {
|
||||
return *(*string)(unsafe.Pointer(&b))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue