Skip to content

Commit

Permalink
chore: Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ikawaha committed Apr 20, 2024
1 parent 08386d5 commit 0287b37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tokenizer/lattice/mem/pool.go
Expand Up @@ -17,13 +17,13 @@ type Pool[T any] struct {
internal *sync.Pool
}

// NewPool returns a memory pool of T. f is a constructor of T and it is called
// NewPool returns a memory pool of T. newF is a constructor of T, and it is called
// when the memory pool is empty.
func NewPool[T any](f func() *T) Pool[T] {
func NewPool[T any](newF func() *T) Pool[T] {
return Pool[T]{
internal: &sync.Pool{
New: func() any {
return f()
return newF()
},
},
}
Expand Down

0 comments on commit 0287b37

Please sign in to comment.