mirror of
https://github.com/aljazceru/khatru.git
synced 2025-12-18 22:14:22 +01:00
replace mutex-guarded maps with xsync/v2 maps.
This commit is contained in:
4
utils.go
4
utils.go
@@ -2,7 +2,9 @@ package khatru
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hash/maphash"
|
||||
"regexp"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -23,3 +25,5 @@ func GetAuthed(ctx context.Context) string {
|
||||
}
|
||||
return authedPubkey.(string)
|
||||
}
|
||||
|
||||
func pointerHasher[V any](_ maphash.Seed, k *V) uint64 { return uint64(uintptr(unsafe.Pointer(k))) }
|
||||
|
||||
Reference in New Issue
Block a user