Skip to content

Commit a2f43a2

Browse files
committed
Use option.value instead pattern match
1 parent 9bfe815 commit a2f43a2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/util/loopUnrolling.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,8 @@ let fixedLoopSize loopStatement func =
264264
None
265265
else
266266
constBefore var loopStatement func >>= fun start ->
267-
let diff =
268-
match assignmentDifference (loopBody loopStatement) var with
269-
| Some d -> d
270-
| 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 *)
271-
in
267+
(* When we find a fixed loop and its start, but cannot detect the increment within the loop, we assume the increment is 1 *)
268+
let diff = Option.value (assignmentDifference (loopBody loopStatement) var) ~default:Z.one in
272269
Logs.debug "comparison: ";
273270
Pretty.fprint stderr (dn_exp () comparison) ~width:max_int;
274271
Logs.debug "";

0 commit comments

Comments
 (0)