@@ -383,22 +383,19 @@ module Base =
383383 Fun. protect ~finally: (fun () -> (
384384 if narrow_globs_eliminate_dead then begin
385385 let prev_sides_x = HM. find_option prev_sides x in
386- begin match prev_sides_x with
387- | Some prev_sides_x -> VS. iter (fun y ->
388- if Option. is_none @@ HM. find_option acc y then begin
389- ignore @@ divided_side D_Narrow x y (S.Dom. bot () );
390- if S.Dom. is_bot @@ HM. find rho y then
391- let casualties = S. postmortem y in
392- List. iter (fun x -> solve x Widen ) casualties
393- end ;
394- ) prev_sides_x
395- | None -> () end ;
396- let new_sides = ref VS. empty in
397- HM. iter (fun y _ -> new_sides := VS. add y ! new_sides) acc;
398- if VS. is_empty ! new_sides then
386+ Option. may (VS. iter (fun y ->
387+ if not @@ HM. mem acc y then begin
388+ ignore @@ divided_side D_Narrow x y (S.Dom. bot () );
389+ if S.Dom. is_bot @@ HM. find rho y then
390+ let casualties = S. postmortem y in
391+ List. iter (fun x -> solve x Widen ) casualties
392+ end ;
393+ )) prev_sides_x;
394+ let new_sides = HM. fold (fun k _ acc -> VS. add k acc) acc VS. empty in
395+ if VS. is_empty new_sides then
399396 HM. remove prev_sides x
400397 else
401- HM. replace prev_sides x ! new_sides;
398+ HM. replace prev_sides x new_sides;
402399 end ;
403400 if narrow_globs_immediate_growth then
404401 HM. iter (fun y acc -> if not @@ HM. mem changed y then ignore @@ divided_side D_Narrow x y acc) acc
0 commit comments