// delete removes the provided key from the node and returns any key that
// was deleted.  Returns nil of the key could not be found.
345639
func (n *Node) delete(comparator Comparator, key *Key) *Key {
	i := n.search(comparator, key.Value)
	if i == len(n.ChildValues) {
		return nil
	}

	n.deleteValueAt(i)
	n.deleteKeyAt(i)

	return key
}
923473
func (s *DBStore) Delete(key string) (err error) {
	return s.db.Delete([]byte(key), nil)
}
136646
func (c *CMap) Delete(key interface{}) {
	c.mutex.Lock()
	delete(c.items, key)
	c.mutex.Unlock()
}
1014333
func (tx *bytesTxn) Delete(key string) keyval.BytesTxn {
	tx.ops = append(tx.ops, clientv3.OpDelete(key))
	return tx
}
184875
func (c *Cache) Delete(key string) {
	key = keyToFilename(key)
	c.d.Erase(key)
}
269700
func (t *Trie) Delete(key []byte) (value interface{}, ok bool) {
	// an empty tree
	if t.size == 0 {
		return
	}

	var direction int
	var whereq *node // pointer to the grandparent
	var wherep *node = &t.root

	// finding the best candidate to delete
	for in := wherep.internal; in != nil; in = wherep.internal {
		direction = in.direction(key)
		whereq = wherep
		wherep = &in.child[direction]
	}

	// checking that we have the right element
	if !bytes.Equal(wherep.external.key, key) {
		return
	}
	value = wherep.external.value
	ok = true

	// removing the node
	if whereq == nil {
		wherep.external = nil
	} else {
		othern := whereq.internal.child[1-direction]
		whereq.internal = othern.internal
		whereq.external = othern.external
	}
	t.size -= 1
	return
}
575936
func (c *Cache) Delete(key Key) {
	logger.Debugf("%s - Deleting cache key", key.String())
	value, ok := c.m.Load(key.String())
	if ok {
		c.close(key.String(), value.(future))
		c.m.Delete(key.String())
	}
}
896059
func (r *MemoryTTL) Delete(key string) error {
	r.Lock()
	defer r.Unlock()

	r.delete(key)
	return nil
}
211956
func (t *LLRB) Delete(key Item) Item {
	var deleted Item
	t.root, deleted = t.delete(t.root, key)
	if t.root != nil {
		t.root.Black = true
	}
	if deleted != nil {
		t.count--
	}
	return deleted
}
800285
func (c *MemcacheCacher) Delete(key string) error {
	return c.c.Delete(key)
}
706944
func (l *SimpleLRUCache) Delete(key Key) {
	k := string(key.Hash())
	element := l.elements[k]
	if element == nil {
		return
	}
	l.cache.Remove(element)
	delete(l.elements, k)
	l.size--
}
1250171
func (b *Bucket) Delete(key []byte) error {
	_ = b.btree.Delete(&item{key: key})
	return nil
}
1266454
func (n *node) Delete(bucketName string, key interface{}) error {
	id, err := toBytes(key, n.codec)
	if err != nil {
		return err
	}

	return n.readWriteTx(func(tx *bolt.Tx) error {
		return n.delete(tx, bucketName, id)
	})
}
367014
func (tx *Txn) Delete(key string) keyval.BytesTxn {
	if tx.addPrefix != nil {
		key = tx.addPrefix(key)
	}
	tx.ops = append(tx.ops, op{key, nil, true})
	return tx
}
995823
func (s *Simple) Delete(key string) {
	atomic.AddInt64(&s.stats.Deletes, 1)

	s.lock.RLock()
	_, ok := s.data[key]
	s.lock.RUnlock()
	if !ok {
		// If key is not in the data map then there is nothing to delete.
		return
	}

	// Element is in data map, but need to acquire exclusive map lock before we
	// delete it.
	s.lock.Lock()
	delete(s.data, key)
	s.lock.Unlock()
}
471665
func (l *LFUNoTS) Delete(key string) error {
	res, err := l.cache.Get(key)
	if err != nil && err != ErrNotFound {
		return err
	}

	// we dont need to delete if already doesn't exist
	if err == ErrNotFound {
		return nil
	}

	ci := res.(*cacheItem)

	l.remove(ci, ci.freqElement)
	l.currentSize--
	return l.cache.Delete(key)
}
243633
func (m *mruNonceMap) Delete(nonce uint64) {
	m.mtx.Lock()
	if node, exists := m.nonceMap[nonce]; exists {
		m.nonceList.Remove(node)
		delete(m.nonceMap, nonce)
	}
	m.mtx.Unlock()
}