Use any instead of interface{}

Signed-off-by: chenyahui <cyhone@qq.com>
This commit is contained in:
chenyahui
2023-09-17 17:41:58 +08:00
parent fb8a315be6
commit c0aa3b613b
61 changed files with 227 additions and 227 deletions

View File

@ -45,13 +45,13 @@ func (h ttlKeyHeap) Swap(i, j int) {
h.keyMap[h.array[j]] = j
}
func (h *ttlKeyHeap) Push(x interface{}) {
func (h *ttlKeyHeap) Push(x any) {
n, _ := x.(*node)
h.keyMap[n] = len(h.array)
h.array = append(h.array, n)
}
func (h *ttlKeyHeap) Pop() interface{} {
func (h *ttlKeyHeap) Pop() any {
old := h.array
n := len(old)
x := old[n-1]
@ -77,7 +77,7 @@ func (h *ttlKeyHeap) pop() *node {
return n
}
func (h *ttlKeyHeap) push(x interface{}) {
func (h *ttlKeyHeap) push(x any) {
heap.Push(h, x)
}