From a1f65716b86aa497941b79a8dfb2475e71a7d461 Mon Sep 17 00:00:00 2001 From: Ryan Rhee Date: Fri, 30 Sep 2016 12:19:36 -0700 Subject: [PATCH] [clang][frontend] Simplify is_objc_if_descendant logic Reviewed By: dulmarod Differential Revision: D3940571 fbshipit-source-id: 6f2edee --- infer/src/clang/cFrontend_utils.ml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/infer/src/clang/cFrontend_utils.ml b/infer/src/clang/cFrontend_utils.ml index dd0de7cef..50d7996b1 100644 --- a/infer/src/clang/cFrontend_utils.ml +++ b/infer/src/clang/cFrontend_utils.ml @@ -455,15 +455,9 @@ struct match if_decl with | Some Clang_ast_t.ObjCInterfaceDecl (_, ndi, _, _, _) -> let in_list some_list = IList.mem string_equal ndi.Clang_ast_t.ni_name some_list in - if in_list ancestors then - true - else if in_list blacklist then - false - else - (match get_super_if if_decl with - | Some super_decl -> - is_objc_if_descendant (Some super_decl) ancestors - | None -> false) + not (in_list blacklist) + && (in_list ancestors + || is_objc_if_descendant ~blacklist:blacklist (get_super_if if_decl) ancestors) | _ -> false (*