mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
refactor: use setCurrentSub instead of pauseTracking
This commit is contained in:
parent
571d2c0d91
commit
a53683d59e
9 changed files with 21 additions and 24 deletions
|
|
@ -25,9 +25,9 @@ local function simpleMapped(source: () -> { Entry }, mapper: (Entry, number) ->
|
|||
local nextState = {}
|
||||
|
||||
for index, value in state do
|
||||
local prevSub = setCurrentSub(nil)
|
||||
local currentSub = setCurrentSub(nil)
|
||||
local success, valueOut, keyOut = pcall(mapper, value, index)
|
||||
setCurrentSub(prevSub)
|
||||
setCurrentSub(currentSub)
|
||||
|
||||
if success then
|
||||
nextState[keyOut] = valueOut
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue