Replace all interface{} to any

This commit is contained in:
Tnze
2023-04-05 19:35:20 +08:00
parent 195945e4ca
commit a42267ba31
21 changed files with 52 additions and 52 deletions

View File

@ -54,7 +54,7 @@ func (g *Graph) Execute(ctx context.Context, cmd string) error {
}
}
type ParsedData interface{}
type ParsedData any
type HandlerFunc func(ctx context.Context, args []ParsedData) error

View File

@ -121,7 +121,7 @@ func (t *Tree[I, B, V]) Insert(leaf B, value V) (n *Node[I, B, V]) {
return
}
func (t *Tree[I, B, V]) Delete(n *Node[I, B, V]) interface{} {
func (t *Tree[I, B, V]) Delete(n *Node[I, B, V]) any {
if n.parent == nil {
// n is the root
t.root = nil
@ -204,11 +204,11 @@ type (
}
)
func (h searchHeap[I, V]) Len() int { return len(h) }
func (h searchHeap[I, V]) Less(i, j int) bool { return h[i].inheritedCost < h[j].inheritedCost }
func (h searchHeap[I, V]) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h *searchHeap[I, V]) Push(x interface{}) { *h = append(*h, x.(searchItem[I, V])) }
func (h *searchHeap[I, V]) Pop() interface{} {
func (h searchHeap[I, V]) Len() int { return len(h) }
func (h searchHeap[I, V]) Less(i, j int) bool { return h[i].inheritedCost < h[j].inheritedCost }
func (h searchHeap[I, V]) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h *searchHeap[I, V]) Push(x any) { *h = append(*h, x.(searchItem[I, V])) }
func (h *searchHeap[I, V]) Pop() any {
old := *h
n := len(old)
x := old[n-1]