Fixed util.Memo
This commit is contained in:
parent
5864c74691
commit
6192a1e9cc
@ -83,6 +83,7 @@ func NewMemo[T any] (update func () T) Memo[T] {
|
|||||||
func (this *Memo[T]) Value () T {
|
func (this *Memo[T]) Value () T {
|
||||||
if !this.valid {
|
if !this.valid {
|
||||||
this.cache = this.update()
|
this.cache = this.update()
|
||||||
|
this.valid = true
|
||||||
}
|
}
|
||||||
return this.cache
|
return this.cache
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user