Skip to content

Commit

Permalink
driver/common: Hoist nil check out of loop and pass function directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz authored and andydotxyz committed Dec 18, 2023
1 parent 119a6ea commit 0afc194
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/driver/common/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,9 @@ func (c *Canvas) FreeDirtyTextures() (freed uint64) {
}
}

cache.RangeExpiredTexturesFor(c.impl, func(obj fyne.CanvasObject) {
if c.painter != nil {
c.painter.Free(obj)
}
})
if c.painter != nil {
cache.RangeExpiredTexturesFor(c.impl, c.painter.Free)
}
return
}

Expand Down

0 comments on commit 0afc194

Please sign in to comment.