mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-30 01:37:04 +08:00
优化代码
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
|
||||
package linkedlist
|
||||
|
||||
type Item struct {
|
||||
prev *Item
|
||||
next *Item
|
||||
type Item[T any] struct {
|
||||
prev *Item[T]
|
||||
next *Item[T]
|
||||
|
||||
Value interface{}
|
||||
Value T
|
||||
}
|
||||
|
||||
func NewItem(value interface{}) *Item {
|
||||
return &Item{Value: value}
|
||||
func NewItem[T any](value T) *Item[T] {
|
||||
return &Item[T]{Value: value}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user