Skip to content

Commit bc771ac

Browse files
committed
Add reapply for Sequential
1 parent c2cb57c commit bc771ac

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/transforms/sequential.jl

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ function revert(s::Sequential, newtable, cache)
3232
current
3333
end
3434

35+
function reapply(s::Sequential, table, cache)
36+
# basic checks
37+
ntrans = length(s.transforms)
38+
ncache = length(cache)
39+
@assert ntrans == ncache "invalid cache for transform"
40+
41+
current = table
42+
for (ctransform, ccache) in zip(s.transforms, cache)
43+
current, _ = reapply(ctransform, current, ccache)
44+
end
45+
current, cache
46+
end
47+
3548
"""
3649
transform₁ → transform₂ → ⋯ → transformₙ
3750

0 commit comments

Comments
 (0)