From fec8950c1bce7827b65bb6a638ded066b9b35125 Mon Sep 17 00:00:00 2001 From: Kyle Daruwalla Date: Thu, 3 Nov 2022 09:56:24 -0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Brian Chen --- src/maps.jl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/maps.jl b/src/maps.jl index 6536928..bc4d054 100644 --- a/src/maps.jl +++ b/src/maps.jl @@ -4,10 +4,9 @@ function fmap(f, x, ys...; exclude = isleaf, walk = DefaultWalk(), cache = IdDict(), prune = NoKeyword()) - _walk = if isnothing(cache) - ExcludeWalk(AnonymousWalk(walk), f, exclude) - else - CachedWalk(ExcludeWalk(AnonymousWalk(walk), f, exclude), prune, cache) + _walk = ExcludeWalk(AnonymousWalk(walk), f, exclude) + if isnothing(cache) + _walk = CachedWalk(_walk, prune, cache) end fmap(_walk, f, x, ys...) end