chore: allow embedded xsync.Map to be lazily initialized

This commit is contained in:
wwqgtxx
2025-07-15 17:33:36 +08:00
parent 349b773b40
commit aa555ced5f
9 changed files with 42 additions and 43 deletions

View File

@@ -14,7 +14,6 @@ var DefaultManager *Manager
func init() {
DefaultManager = &Manager{
connections: xsync.NewMap[string, Tracker](),
uploadTemp: atomic.NewInt64(0),
downloadTemp: atomic.NewInt64(0),
uploadBlip: atomic.NewInt64(0),
@@ -28,7 +27,7 @@ func init() {
}
type Manager struct {
connections *xsync.Map[string, Tracker]
connections xsync.Map[string, Tracker]
uploadTemp atomic.Int64
downloadTemp atomic.Int64
uploadBlip atomic.Int64