mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-08-22 17:46:48 +08:00
Change to TypedSyncMap
This commit is contained in:
@@ -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{},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user