File tree Expand file tree Collapse file tree
analysis_and_optimization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -799,10 +799,10 @@ let dead_code_elimination (mir : Program.Typed.t) =
799799 else For {loopvar; lower; upper; body}
800800 | Profile (name , l ) ->
801801 let l' = List. filter ~f: (fun x -> x.pattern <> Skip ) l in
802- if List. length l' = 0 then Skip else Profile (name, l')
802+ if List. is_empty l' then Skip else Profile (name, l')
803803 | Block l ->
804804 let l' = List. filter ~f: (fun x -> x.pattern <> Skip ) l in
805- if List. length l' = 0 then Skip else Block l'
805+ if List. is_empty l' then Skip else Block l'
806806 | SList l ->
807807 let l' = List. filter ~f: (fun x -> x.pattern <> Skip ) l in
808808 SList l' in
@@ -1023,7 +1023,7 @@ let lazy_code_motion ?(preserve_stability = false) (mir : Program.Typed.t) =
10231023 (Map. mapi expression_map ~f: (fun ~key ~data ->
10241024 {key with pattern= Var data})) in
10251025 let f = expr_subst_stmt_except_initial_assign expr_map in
1026- if List. length assignments_to_add_to_s = 0 then
1026+ if List. is_empty assignments_to_add_to_s then
10271027 (f Stmt. {pattern= stmt; meta= Location_span. empty}).pattern
10281028 else
10291029 SList
Original file line number Diff line number Diff line change @@ -13,5 +13,5 @@ let pp ?printed_filename ppf (span, message) =
1313 Fmt. pf ppf " @[<v4>%a%a%a@]@]" purple " Warning" maybe_loc span Fmt. text message
1414
1515let pp_warnings ?printed_filename ppf warnings =
16- if List. length warnings > 0 then
16+ if not ( Core. List.is_empty warnings) then
1717 Fmt. (pf ppf " @[<v>%a@]@\n " (list ~sep: cut (pp ?printed_filename)) warnings)
You can’t perform that action at this time.
0 commit comments