From 4a4e8c6e1b90614a185b15a5b2e533b743d23a00 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Mon, 19 Nov 2018 08:08:33 -0800 Subject: [PATCH] concat_traces: always print labels Reviewed By: jvillard Differential Revision: D13118979 fbshipit-source-id: 0875b7777 --- infer/src/IR/Errlog.ml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/infer/src/IR/Errlog.ml b/infer/src/IR/Errlog.ml index 52c7312df..eb6579c4d 100644 --- a/infer/src/IR/Errlog.ml +++ b/infer/src/IR/Errlog.ml @@ -46,20 +46,14 @@ let make_trace_element lt_level lt_loc lt_description lt_node_tags = type loc_trace = loc_trace_elem list let concat_traces labelled_traces = - match labelled_traces with - | [] -> - [] - | [(_, t)] -> - t - | _ -> - List.fold_right labelled_traces ~init:[] ~f:(fun labelled_trace res -> - match labelled_trace with - | _, [] -> - res - | "", trace -> - trace @ res - | label, ({lt_loc} :: _ as trace) -> - (make_trace_element 0 lt_loc label [] :: trace) @ res ) + List.fold_right labelled_traces ~init:[] ~f:(fun labelled_trace res -> + match labelled_trace with + | _, [] -> + res + | "", trace -> + trace @ res + | label, ({lt_loc} :: _ as trace) -> + (make_trace_element 0 lt_loc label [] :: trace) @ res ) let compute_local_exception_line loc_trace =