Fixed util.Memo

This commit is contained in:
Sasha Koshka 2024-07-25 20:37:09 -04:00
parent 5864c74691
commit 6192a1e9cc

View File

@ -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
} }