return s
}
-func (s *tmplK) Set(key string) (id uintptr) {
+func (s *tmplK) Set(key interface{}) (id uintptr) {
if tmp, oks := s.kvt_map.LoadV(key).(tmplK_item);oks {
s.free(tmp.uid)
return Uid.Id
}
-func (s *tmplK) Get(key string) (isLive bool,id uintptr){
+func (s *tmplK) Get(key interface{}) (isLive bool,id uintptr){
tmp, ok := s.kvt_map.Load(key)
item,_ := tmp.(tmplK_item)
return
}
-func (s *tmplK) Check(key string,id uintptr) bool {
+func (s *tmplK) Check(key interface{},id uintptr) bool {
ok,k := s.Get(key)
- return ok && k == id
+ return ok && (k == id)
}
func (s *tmplK) Len() (int64,int) {
func (s *tmplK) free(i *idpool.Id) {
s.slowBackList.PushBack(i)
if s.freeLen() > s.SumInDruation {
- if el := s.slowBackList.Front();el != nil{
+ if el := s.slowBackList.Front();el != nil && el.Value != nil{
e := s.slowBackList.Remove(el)
s.pool.Put(e.(*idpool.Id))
}