diff --git a/memorykv/driver.go b/memorykv/driver.go index cf9a0b4..739f660 100644 --- a/memorykv/driver.go +++ b/memorykv/driver.go @@ -274,7 +274,7 @@ func (d *Driver) Delete(ctx context.Context, keys ...string) error { } for _, key := range keys { - d.heap.LoadAndDelete(key) + d.heap.Delete(key) } return nil diff --git a/memorykv/map.go b/memorykv/map.go index 645fe25..4b1af02 100644 --- a/memorykv/map.go +++ b/memorykv/map.go @@ -30,24 +30,6 @@ func (h *hmap) Set(key string, item *Item) { h.items[key] = item } -func (h *hmap) LoadAndDelete(key string) (*Item, bool) { - h.mu.Lock() - defer h.mu.Unlock() - - item, ok := h.items[key] - if ok { - if item.callback != nil { - select { - case item.callback.stopCh <- struct{}{}: - default: - } - } - delete(h.items, key) - } - - return item, ok -} - func (h *hmap) Clean() { h.mu.Lock() defer h.mu.Unlock()