From 51763fc58a9eb58c0e5305f5838c70e9c9d42975 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 21 Jun 2024 11:36:18 +0800 Subject: [PATCH] 1 --- server/marketserver/mt/Item.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/marketserver/mt/Item.go b/server/marketserver/mt/Item.go index 3b634625..80d4cb73 100644 --- a/server/marketserver/mt/Item.go +++ b/server/marketserver/mt/Item.go @@ -1,6 +1,7 @@ package mt import ( + "q5" "f5" "mtb" "strings" @@ -13,12 +14,17 @@ type Item struct { type ItemTable struct { f5.IdMetaTable[Item] + itemIdHash *q5.ConcurrentMap[int64, *Item] } func (this *Item) Init1() { this.lowerName = strings.ToLower(this.GetName()) } +func (this *ItemTable) Load() { + this.itemIdHash = new(q5.ConcurrentMap[int64, *Item]) +} + func (this *ItemTable) Search(name string, itemIds map[int32]int32) { name = strings.ToLower(name) this.Traverse(