From a4098f2499a3fa2cfee44dc5263cef08f84fb1e3 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 29 May 2018 10:06:58 -0700 Subject: [PATCH] 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 --- infer/src/IR/Procdesc.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infer/src/IR/Procdesc.ml b/infer/src/IR/Procdesc.ml index ec2f29774..1a8fa5322 100644 --- a/infer/src/IR/Procdesc.ml +++ b/infer/src/IR/Procdesc.ml @@ -290,14 +290,14 @@ let is_defined pdesc = pdesc.attributes.is_defined 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 do_node node = List.iter ~f:(fun i -> f node i) (Node.get_instrs node) in 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_node acc node =