1
This commit is contained in:
parent
e109c6fbe6
commit
74446ec857
2
server/marketserver/cache/cachemgr.go
vendored
2
server/marketserver/cache/cachemgr.go
vendored
@ -13,7 +13,7 @@ type cacheMgr struct {
|
||||
}
|
||||
|
||||
func (this *cacheMgr) Init() {
|
||||
|
||||
this.nftHash = new(q5.ConcurrentMap[string, *nft])
|
||||
}
|
||||
|
||||
func (this *cacheMgr) UnInit() {
|
||||
|
@ -3,7 +3,6 @@ package mt
|
||||
import (
|
||||
"f5"
|
||||
"mtb"
|
||||
"sync"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -13,7 +12,6 @@ type Contract struct {
|
||||
|
||||
type ContractTable struct {
|
||||
f5.NameMetaTable[Contract]
|
||||
itemHash sync.Map //string => Contract
|
||||
}
|
||||
|
||||
func (this *Contract) Init1() {
|
||||
|
@ -3,30 +3,28 @@ package mt
|
||||
import (
|
||||
"f5"
|
||||
"mtb"
|
||||
"sync"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Item struct {
|
||||
mtb.Item
|
||||
lowerName string
|
||||
}
|
||||
|
||||
type ItemTable struct {
|
||||
f5.IdMetaTable[Item]
|
||||
itemHash sync.Map //string => item_id
|
||||
}
|
||||
|
||||
func (this *Item) Init1() {
|
||||
Table.Item.itemHash.Store(strings.ToLower(this.GetName()), this.GetItemId())
|
||||
this.lowerName = strings.ToLower(this.GetName())
|
||||
}
|
||||
|
||||
func (this *ItemTable) Search(name string, itemIds map[int32]int32) {
|
||||
name = strings.ToLower(name)
|
||||
this.itemHash.Range(
|
||||
func (k, v interface{}) bool {
|
||||
key := k.(string)
|
||||
if strings.Contains(key, name) {
|
||||
itemIds[v.(int32)] = 1
|
||||
this.Traverse(
|
||||
func (ele *Item) bool {
|
||||
if strings.Contains(ele.lowerName, name) {
|
||||
itemIds[ele.GetItemId()] = 1
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user