Skip to content

Commit 5d5575c

Browse files
committed
Use a loop instead of an inline declared table at the end of the sha256_file function.
1 parent 2ad024c commit 5d5575c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/S256SUM.LUA

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ function sha256_file(file)
9696
local function h(x)
9797
return string.format("%08x", x)
9898
end
99-
return table.concat({ h(H[1]), h(H[2]), h(H[3]), h(H[4]), h(H[5]), h(H[6]), h(H[7]), h(H[8]) }) --#squish keep-eol
99+
l = {}
100+
for _, v in ipairs(H) do
101+
table.insert(l, h(v))
102+
end
103+
return table.concat(l) --#squish keep-eol
100104
end
101105

102106
if LIB then

0 commit comments

Comments
 (0)