]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
stand: lua: enhance lfs.dir() to speed up kernels_autodetect
authorKyle Evans <kevans@FreeBSD.org>
Sun, 24 Jan 2021 01:32:38 +0000 (19:32 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Wed, 3 Feb 2021 06:55:47 +0000 (00:55 -0600)
commit13de72571eb2532e253fb8d40edf47ebabb99e92
treee4a41b3fc38fc8c6edcf7862d9dc3256adc521e6
parent10625515ad47b52f38c13f4f1d8f8c848e9df4ee
stand: lua: enhance lfs.dir() to speed up kernels_autodetect

This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up rendering on my
laptop.

ftype is nil if loader/loader.efi hasn't been updated yet, falling back to
lfs.attributes() to test.

This is technically incompatible with lfs, but not in a particularly
terrible way.

(cherry picked from commit e25ee296c919d6567aa76058a7049eac974797fb)
libexec/flua/modules/lfs.c
stand/lua/core.lua