Skip to content

Commit

Permalink
Use modifyi where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Dec 27, 2023
1 parent 29b8ca2 commit 4f113e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cdomains/apron/affineEqualityDomain.apron.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct
let copy t = {t with d = Option.map Matrix.copy t.d}

let dim_add (ch: Apron.Dim.change) m =
Array.iteri (fun i x -> ch.dim.(i) <- x + i) ch.dim;
Array.modifyi (fun i x -> x + i) ch.dim; (* could be written Array.modifyi (+) ch.dim; but that's too smart *)
Matrix.add_empty_columns m ch.dim

let dim_add ch m = timing_wrap "dim add" (dim_add ch) m
Expand All @@ -62,7 +62,7 @@ struct
if Array.length ch.dim = 0 || Matrix.is_empty m then
m
else (
Array.iteri (fun i x-> ch.dim.(i) <- x + i) ch.dim;
Array.modifyi (fun i x -> x + i) ch.dim;
let m' = if not del then let m = Matrix.copy m in Array.fold_left (fun y x -> Matrix.reduce_col_with y x; y) m ch.dim else m in
Matrix.remove_zero_rows @@ Matrix.del_cols m' ch.dim)

Expand Down

0 comments on commit 4f113e1

Please sign in to comment.