Skip to content

Commit e402dad

Browse files
darsnackToucheSir
andcommitted
Apply suggestions from code review
Co-authored-by: Brian Chen <ToucheSir@users.noreply.github.com>
1 parent 31cb97a commit e402dad

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/maps.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ function fmap(f, x, ys...; exclude = isleaf,
44
walk = DefaultWalk(),
55
cache = IdDict(),
66
prune = NoKeyword())
7-
_walk = if isnothing(cache)
8-
ExcludeWalk(AnonymousWalk(walk), f, exclude)
9-
else
10-
CachedWalk(ExcludeWalk(AnonymousWalk(walk), f, exclude), prune, cache)
7+
_walk = ExcludeWalk(AnonymousWalk(walk), f, exclude)
8+
if !isnothing(cache)
9+
_walk = CachedWalk(_walk, prune, cache)
1110
end
1211
fmap(_walk, f, x, ys...)
1312
end

0 commit comments

Comments
 (0)