replace mutex-guarded maps with xsync/v2 maps.

This commit is contained in:
fiatjaf
2023-10-03 08:32:07 -03:00
parent 24d1e3aebd
commit bbe186494e
7 changed files with 33 additions and 52 deletions

View File

@@ -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))) }