Skip to content

Commit

Permalink
use compact if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Nov 18, 2023
1 parent 8afdc18 commit 13f5c4b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions widget/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,16 +663,15 @@ func (l *listLayout) updateList(newOnly bool) {
row := index + minRow
size := fyne.NewSize(width, itemHeight)

visIdx := l.searchVisible(l.wasVisible, row)
var c *listItem
if visIdx < 0 {
if idx := l.searchVisible(l.wasVisible, row); idx < 0 {
c = l.getItem()
if c == nil {
continue
}
c.Resize(size)
} else {
c = l.wasVisible[visIdx].item
c = l.wasVisible[idx].item
}

c.Move(fyne.NewPos(0, y))
Expand Down

0 comments on commit 13f5c4b

Please sign in to comment.