func (c *CacheU64) Delete(key uint64) {
	e := c.entries[key]
	if e == nil {
		return
	}
	delete(c.entries, key)
	if len(c.entries) == 0 {
		c.head = nil
		c.tail = nil
	} else if e == c.head {
		c.head = c.head.next
		c.head.prev = nil
	} else if e == c.tail {
		c.tail = c.tail.prev
		c.tail.next = nil
	} else {
		e.prev.next = e.next
		e.next.prev = e.prev
	}
}
Delete an entry from cache.
package lru
type entryU64 struct {
	key   uint64
	value interface{}
	prev  *entryU64
	next  *entryU64
}
type CacheU64 struct {
	entries map[uint64]*entryU64
	size    int
	onEvict func(key uint64, value interface{})
	head    *entryU64
	tail    *entryU64
}
func NewU64(size int, onEvict func(key uint64, value interface{})) *CacheU64 {
	if size <= 0 {
		panic("invalid size")
	}
	return &CacheU64{
		entries: make(map[uint64]*entryU64, int(float64(size)*1.5)),
		size:    size,
		onEvict: onEvict,
	}
}
func (c *CacheU64) Set(key uint64, value interface{}) {
	e := c.entries[key]
	if e == nil {
		e = &entryU64{key: key, value: value}
		c.entries[key] = e
		if c.head == nil {
			c.head = e
			c.tail = e
		} else {
			c.head.prev = e
			e.next = c.head
			c.head = e
		}
	} else {
		e.value = value
		c.promote(e)
	}
	if len(c.entries) > c.size {
		evicted := c.tail
		delete(c.entries, c.tail.key)
		c.tail = c.tail.prev
		c.tail.next = nil
		if c.onEvict != nil {
			c.onEvict(evicted.key, evicted.value)
		}
	}
}
func (c *CacheU64) promote(e *entryU64) {
	if c.head != e {
		if c.tail == e {
			c.tail = c.tail.prev
			c.tail.next = nil
		} else {
			e.prev.next = e.next
			e.next.prev = e.prev
		}
		e.prev = nil
		e.next = c.head
		c.head.prev = e
		c.head = e
	}
}
func (c *CacheU64) Len() int {
	return len(c.entries)
}
func (c *CacheU64) Get(key uint64) interface{} {
	e := c.entries[key]
	if e == nil {
		return nil
	}
	c.promote(e)
	return e.value
}