forked from pneymrl2f/nightingale
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
440 B
28 lines
440 B
package cache
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
type ClasspathPrefixMap struct {
|
|
sync.RWMutex
|
|
Data map[int64][]int64
|
|
}
|
|
|
|
var ClasspathPrefix = &ClasspathPrefixMap{Data: make(map[int64][]int64)}
|
|
|
|
func (c *ClasspathPrefixMap) Get(id int64) ([]int64, bool) {
|
|
c.RLock()
|
|
defer c.RUnlock()
|
|
ids, exists := c.Data[id]
|
|
return ids, exists
|
|
}
|
|
|
|
func (c *ClasspathPrefixMap) SetAll(data map[int64][]int64) {
|
|
c.Lock()
|
|
defer c.Unlock()
|
|
|
|
c.Data = data
|
|
return
|
|
}
|