Procdesc.fold_nodes: do not rev

Summary: The order of nodes means nothing, and should not matter, let's save the whales!

Reviewed By: ngorogiannis

Differential Revision: D8182137

fbshipit-source-id: bc14a2c
master
Mehdi Bouaziz 7 years ago committed by Facebook Github Bot
parent c35278a8f8
commit a4098f2499

@ -290,14 +290,14 @@ let is_defined pdesc = pdesc.attributes.is_defined
let is_java_synchronized pdesc = pdesc.attributes.is_java_synchronized_method let is_java_synchronized pdesc = pdesc.attributes.is_java_synchronized_method
let iter_nodes f pdesc = List.iter ~f (List.rev (get_nodes pdesc)) let iter_nodes f pdesc = List.iter ~f (get_nodes pdesc)
let iter_instrs f pdesc = let iter_instrs f pdesc =
let do_node node = List.iter ~f:(fun i -> f node i) (Node.get_instrs node) in let do_node node = List.iter ~f:(fun i -> f node i) (Node.get_instrs node) in
iter_nodes do_node pdesc iter_nodes do_node pdesc
let fold_nodes pdesc ~init ~f = List.fold ~f ~init (List.rev (get_nodes pdesc)) let fold_nodes pdesc ~init ~f = List.fold ~f ~init (get_nodes pdesc)
let fold_instrs pdesc ~init ~f = let fold_instrs pdesc ~init ~f =
let fold_node acc node = let fold_node acc node =

Loading…
Cancel
Save