@@ -121,8 +121,8 @@ struct TreeMapreducer{
121121end
122122
123123@generated function call_mapreducer (
124- mapreducer:: TreeMapreducer{D,ID,F1,F2,G,H } , tree:: AbstractNode
125- ) where {D,ID,F1,F2,G,H }
124+ mapreducer:: TreeMapreducer{D,ID} , tree:: AbstractNode
125+ ) where {D,ID}
126126 quote
127127 key = ID <: Dict ? objectid (tree) : nothing
128128 if ID <: Dict && haskey (mapreducer. id_map, key)
@@ -369,11 +369,13 @@ function map(
369369 result_type:: Type{RT} = Nothing;
370370 break_sharing:: Val{BS} = Val (false ),
371371) where {F<: Function ,RT,BS}
372- if RT == Nothing
373- return map (f, collect (tree; break_sharing= Val (BS)))
374- else
375- return filter_map (Returns (true ), f, tree, result_type; break_sharing= Val (BS))
376- end
372+ return _map (f, tree, result_type, Val (BS))
373+ end
374+ function _map (f:: F , tree:: AbstractNode , :: Type{Nothing} , :: Val{BS} ) where {F<: Function ,BS}
375+ return map (f, collect (tree; break_sharing= Val (BS)))
376+ end
377+ function _map (f:: F , tree:: AbstractNode , :: Type{RT} , :: Val{BS} ) where {F<: Function ,RT,BS}
378+ return filter_map (Returns (true ), f, tree, RT; break_sharing= Val (BS))
377379end
378380
379381"""
0 commit comments