~eliasnaur/gio

d942b5c4d0f94dbf010696e385729f34e6e4b3a6 — pierre 4 months ago 8a148ad
layout.List: reduce allocations when scrolling backward

Signed-off-by: pierre <pierre.curto@gmail.com>
1 files changed, 3 insertions(+), 1 deletions(-)

M layout/list.go
M layout/list.go => layout/list.go +3 -1
@@ 184,7 184,9 @@ func (l *List) end(dims Dimensions, call op.CallOp) {
	case iterateForward:
		l.children = append(l.children, child)
	case iterateBackward:
		l.children = append([]scrollChild{child}, l.children...)
		l.children = append(l.children, scrollChild{})
		copy(l.children[1:], l.children)
		l.children[0] = child
		l.Position.First--
		l.Position.Offset += mainSize
	default: