优化代码

This commit is contained in:
刘祥超
2023-10-03 21:38:45 +08:00
parent 1eca5099df
commit 5c5adf690f
6 changed files with 46 additions and 41 deletions

View File

@@ -9,7 +9,7 @@ import (
type OpenFilePool struct {
c chan *OpenFile
linkItem *linkedlist.Item
linkItem *linkedlist.Item[*OpenFilePool]
filename string
version int64
isClosed bool
@@ -21,7 +21,7 @@ func NewOpenFilePool(filename string) *OpenFilePool {
c: make(chan *OpenFile, 1024),
version: fasttime.Now().UnixMilli(),
}
pool.linkItem = linkedlist.NewItem(pool)
pool.linkItem = linkedlist.NewItem[*OpenFilePool](pool)
return pool
}