From a7bb4bd320db89f25444c0517b74836807bcdb00 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Tue, 30 Mar 2021 07:55:28 -0700 Subject: [PATCH] [ConfigImpact] Compare unchecked callees if lengths are the same Summary: One source of non-deterministic diff result is when there are multiple overloaded methods the cardinals of unchecked callees of which are the same. This diff tries to select one of them in a more deterministic manner. Reviewed By: ezgicicek, ngorogiannis Differential Revision: D27430757 fbshipit-source-id: 38ba5d8dc --- infer/src/integration/Differential.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infer/src/integration/Differential.ml b/infer/src/integration/Differential.ml index 569447eab..4aa58d852 100644 --- a/infer/src/integration/Differential.ml +++ b/infer/src/integration/Differential.ml @@ -406,7 +406,8 @@ module ConfigImpactItem = struct type change_type = Added | Removed let compare_by_unchecked_callees_length {unchecked_callees= u1} {unchecked_callees= u2} = - Int.compare (UncheckedCallees.cardinal u1) (UncheckedCallees.cardinal u2) + let c = Int.compare (UncheckedCallees.cardinal u1) (UncheckedCallees.cardinal u2) in + if c <> 0 then c else UncheckedCallees.compare u1 u2 let pp_change_type f x =