[refactor] Remove `else ()`

Reviewed By: jvillard

Differential Revision: D26977396

fbshipit-source-id: a56658e2b
master
Ezgi Çiçek 4 years ago committed by Facebook GitHub Bot
parent aae28efb44
commit 36135aed68

@ -771,7 +771,7 @@ let get_loop_heads pdesc =
let is_loop_head pdesc (node : Node.t) = NodeSet.mem node (get_loop_heads pdesc)
let pp_modify_in_block fmt modify_in_block =
if modify_in_block then Format.pp_print_string fmt "(__block)" else ()
if modify_in_block then Format.pp_print_string fmt "(__block)"
let pp_local fmt (var_data : ProcAttributes.var_data) =

@ -346,7 +346,7 @@ and pp_protocols pe f protocols =
(** Pretty print a type. Do nothing by default. *)
let pp pe f te = if Config.print_types then pp_full pe f te else ()
let pp pe f te = if Config.print_types then pp_full pe f te
let to_string typ =
let pp fmt = pp_full Pp.text fmt typ in

@ -38,7 +38,6 @@ let store ~entry ~file m =
DB.filename_from_string (Filename.concat issues_dir (abbrev_source_file ^ ".issue"))
in
Serialization.write_to_file issues_serializer filename ~data:m )
else ()
(** Load issues from the given file *)

@ -172,7 +172,6 @@ end = struct
if not (Exp.equal e e') then (
L.d_strln "failure reason 8" ;
raise Predicates.JoinFail )
else ()
let check side es =

@ -139,7 +139,7 @@ let rec strexp_to_string pe coo f se =
| Eexp (Exp.Lvar pvar, _) ->
(Pvar.pp pe) f pvar
| Eexp (Exp.Var id, _) ->
if !print_full_prop then Ident.pp f id else ()
if !print_full_prop then Ident.pp f id
| Eexp (e, _) ->
if !print_full_prop then (Exp.pp_diff pe) f e else F.pp_print_char f '_'
| Estruct (ls, _) ->
@ -414,7 +414,7 @@ let compute_fields_struct sigma =
let rec do_strexp se in_struct =
match (se : Predicates.strexp) with
| Eexp (e, _) ->
if in_struct then fields_structs := e :: !fields_structs else ()
if in_struct then fields_structs := e :: !fields_structs
| Estruct (l, _) ->
List.iter ~f:(fun e -> do_strexp e true) (snd (List.unzip l))
| Earray (_, l, _) ->
@ -759,7 +759,6 @@ let dotty_pp_link f link =
| _, _ ->
if !print_full_prop then
F.fprintf f "state%iL%i -> state%iL%i[label=\"%s\"];@\n" n1 lambda1 n2 lambda2 src_fld
else ()
(* given the list of nodes and links get rid of spec nodes that are not pointed to by anybody*)

@ -946,7 +946,6 @@ let update_specs analysis_data prev_summary_opt phase
then (
changed := true ;
current_specs := SpecMap.remove old_spec.BiabductionSummary.pre !current_specs )
else ()
in
let add_spec spec =
(* add a new spec by doing union of the posts *)

@ -88,7 +88,7 @@ module SymLinear = struct
let pp : markup:bool -> is_beginning:bool -> F.formatter -> t -> unit =
fun ~markup ~is_beginning f x ->
if M.is_empty x then if is_beginning then F.pp_print_string f "0" else ()
if M.is_empty x then (if is_beginning then F.pp_print_string f "0")
else
( M.fold
(fun s c is_beginning ->

@ -62,20 +62,13 @@ let process_procdesc tenv proc_name proc_desc =
None
in
if Procdesc.is_defined proc_desc && Procname.is_objc_dealloc proc_name then
let struct_opt = get_struct_procname tenv proc_name in
match struct_opt with
| Some {fields} -> (
get_struct_procname tenv proc_name
|> Option.iter ~f:(fun Struct.{fields} ->
let formals = Procdesc.get_formals proc_desc in
let self = List.find ~f:(fun (var, _) -> Mangled.equal var Mangled.self) formals in
match self with
| Some (self, typ) ->
Option.iter self ~f:(fun (self, typ) ->
let self_var = Pvar.mk self proc_name in
process_dealloc proc_desc fields (self_var, typ)
| None ->
() )
| _ ->
()
else ()
process_dealloc proc_desc fields (self_var, typ) ) )
let process cfg tenv = Procname.Hash.iter (process_procdesc tenv) cfg

@ -252,7 +252,7 @@ let add_type_from_decl_ref_opt qual_type_to_sil_type tenv decl_ref_opt fail_if_n
| Some dr ->
add_type_from_decl_ref qual_type_to_sil_type tenv dr
| _ ->
if fail_if_not_found then assert false else ()
if fail_if_not_found then assert false
let add_type_from_decl_ref_list qual_type_to_sil_type tenv decl_ref_list =

Loading…
Cancel
Save