kmod.attr: optimization: do not call strip_compress_sfx() twice

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko 2023-05-04 12:43:01 +02:00
parent 491a3411df
commit 5df3d6d58b

View File

@ -15,16 +15,18 @@
for l in io.lines(fn) do for l in io.lines(fn) do
local builtin_mod = basename(l) local builtin_mod = basename(l)
printdep(builtin_mod) printdep(builtin_mod)
if strip_compress_sfx(builtin_mod) ~= builtin_mod then local nocompr = strip_compress_sfx(builtin_mod)
printdep(strip_compress_sfx(builtin_mod)) if nocompr ~= builtin_mod then
printdep(nocompr)
end end
end end
else else
local mod = string.match(bn, "%g+%.ko") local mod = string.match(bn, "%g+%.ko")
if mod then if mod then
printdep(mod) printdep(mod)
if strip_compress_sfx(mod) ~= mod then local nocompr = strip_compress_sfx(mod)
printdep(strip_compress_sfx(mod)) if nocompr ~= mod then
printdep(nocompr)
end end
end end
end end