Skip to content

Commit

Permalink
Use option.value instead pattern match
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Jun 20, 2024
1 parent 9bfe815 commit a2f43a2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/util/loopUnrolling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,8 @@ let fixedLoopSize loopStatement func =
None
else
constBefore var loopStatement func >>= fun start ->
let diff =
match assignmentDifference (loopBody loopStatement) var with
| Some d -> d
| None -> Z.one (* When we find a fixed loop and its start, but cannot detect the increment within the loop, we assume the increment is 1 *)
in
(* When we find a fixed loop and its start, but cannot detect the increment within the loop, we assume the increment is 1 *)
let diff = Option.value (assignmentDifference (loopBody loopStatement) var) ~default:Z.one in
Logs.debug "comparison: ";
Pretty.fprint stderr (dn_exp () comparison) ~width:max_int;
Logs.debug "";
Expand Down

0 comments on commit a2f43a2

Please sign in to comment.