File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 225225
226226Apply a function to each node in a tree.
227227"""
228- function foreach (f:: Function , tree:: AbstractNode ; break_sharing:: Val = Val (false ))
228+ function foreach (
229+ f:: F , tree:: AbstractNode ; break_sharing:: Val = Val (false )
230+ ) where {F<: Function }
229231 tree_mapreduce (
230232 t -> (@inline (f (t)); nothing ), Returns (nothing ), tree, Nothing; break_sharing
231233 )
@@ -258,12 +260,12 @@ end
258260Equivalent to `filter_map`, but stores the results in a preallocated array.
259261"""
260262function filter_map! (
261- filter_fnc:: Function ,
262- map_fnc:: Function ,
263+ filter_fnc:: F ,
264+ map_fnc:: G ,
263265 destination:: Vector{GT} ,
264266 tree:: AbstractNode ;
265267 break_sharing:: Val = Val (false ),
266- ) where {GT}
268+ ) where {GT,F <: Function ,G <: Function }
267269 pointer = Ref (0 )
268270 foreach (tree; break_sharing) do t
269271 if @inline (filter_fnc (t))
You can’t perform that action at this time.
0 commit comments