HomeFreeBSD

stand/lua: Cache swapped menu, and don't create locals for swapping

Description

stand/lua: Cache swapped menu, and don't create locals for swapping

Building the swapped welcome menu (first two items swapped) is kind of a
sluggish, because it requires a full (recrusive) shallow copy of the welcome
menu. Cache the result of that and re-use it later, instead of building it
everytime.

While here, don't create temporary locals just for swapping. The following
is just as good:

x, y = y, x;

Reported by: Alexander Nasonov <alnsn@yandex.ru> (swapping)

Details

Provenance
kevansAuthored on
Parents
rS329608: Merge from head
Branches
Unknown
Tags
Unknown