From 8097de5bfd8f063193a44140e1c4aa09f9138e68 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 29 Nov 2016 16:36:18 -0800 Subject: [PATCH] ppx_compare Mleak_buckets Reviewed By: cristianoc Differential Revision: D4232387 fbshipit-source-id: 5965bd7 --- infer/src/IR/Mleak_buckets.ml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/infer/src/IR/Mleak_buckets.ml b/infer/src/IR/Mleak_buckets.ml index 75e866d08..9003120cf 100644 --- a/infer/src/IR/Mleak_buckets.ml +++ b/infer/src/IR/Mleak_buckets.ml @@ -22,27 +22,11 @@ let bucket_to_message bucket = | `MLeak_cpp -> "[CPP]" | `MLeak_unknown -> "[UNKNOWN ORIGIN]" -let mleak_bucket_compare b1 b2 = - match b1, b2 with - | `MLeak_all, `MLeak_all -> 0 - | `MLeak_all, _ -> -1 - | _, `MLeak_all -> 1 - | `MLeak_cf, `MLeak_cf -> 0 - | `MLeak_cf, _ -> -1 - | _, `MLeak_cf -> 1 - | `MLeak_arc, `MLeak_arc -> 0 - | `MLeak_arc, _ -> -1 - | _, `MLeak_arc -> 1 - | `MLeak_no_arc, `MLeak_no_arc -> 0 - | `MLeak_no_arc, _ -> -1 - | _, `MLeak_no_arc -> 1 - | `MLeak_unknown, `MLeak_unknown -> 0 - | `MLeak_unknown, _ -> -1 - | _, `MLeak_unknown -> 1 - | `MLeak_cpp, `MLeak_cpp -> 0 +let compare_mleak_bucket = + [%compare: [ `MLeak_all | `MLeak_arc | `MLeak_cf | `MLeak_cpp | `MLeak_no_arc | `MLeak_unknown ]] let mleak_bucket_eq b1 b2 = - mleak_bucket_compare b1 b2 = 0 + compare_mleak_bucket b1 b2 = 0 let contains_all = IList.mem mleak_bucket_eq `MLeak_all Config.ml_buckets