Skip to content

Commit ad77d95

Browse files
committed
Use new table.map() function.
1 parent d1de78e commit ad77d95

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lua/init.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,10 @@ local function get_state(level)
9191
local frame = stack[stack.pos][1]
9292
local file, line = frame[2], frame[4]
9393
-- Lookup stack frames.
94-
local call_stack = {}
95-
for _, frame in ipairs(stack) do
94+
local call_stack = table.map(stack, function(frame)
9695
frame = frame[1]
97-
call_stack[#call_stack + 1] = string.format('(%s) %s:%d', frame[1] or frame[5], frame[2],
98-
frame[4])
99-
end
96+
return string.format('(%s) %s:%d', frame[1] or frame[5], frame[2], frame[4])
97+
end)
10098
call_stack.pos = stack.pos
10199
-- Lookup variables (index 2) and upvalues (index 3) from the current frame.
102100
local variables = {}

0 commit comments

Comments
 (0)