Skip to content

Commit

Permalink
get rid of redundant data-nilling loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Nov 18, 2023
1 parent 1f9735d commit 420a945
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions widget/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,7 @@ func (l *listLayout) updateList(newOnly bool) {
fyne.LogError("Missing UpdateCell callback required for List", nil)
}

for i := 0; i < len(l.wasVisible); i++ {
l.wasVisible[i].item = nil
}
l.wasVisible = l.wasVisible[:0]
l.wasVisible = l.wasVisible[:0] // data already nilled out at end of this func
l.wasVisible = append(l.wasVisible, l.visible...)

l.list.propertyLock.Lock()
Expand Down

0 comments on commit 420a945

Please sign in to comment.