mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-07-29 21:34:15 +00:00
Change to TypedSyncMap
This commit is contained in:
parent
b6b51c51c8
commit
20825f6f1a
6 changed files with 29 additions and 31 deletions
|
@ -15,8 +15,8 @@ type TypedSyncMap[K, V any] struct {
|
|||
// K is key type, V is value type
|
||||
// It is recommended to use pointer types for V because sync.Map might return nil
|
||||
// If sync.Map methods really returned nil, it will return the zero value of the type V
|
||||
func NewTypedSyncMap[K any, V any]() *TypedSyncMap[K, V] {
|
||||
return &TypedSyncMap[K, V]{
|
||||
func NewTypedSyncMap[K any, V any]() TypedSyncMap[K, V] {
|
||||
return TypedSyncMap[K, V]{
|
||||
syncMap: &sync.Map{},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue