@@ -11478,7 +11478,7 @@ sig
11478
11478
*)
11479
11479
val unsafe_internal_array : t -> elt array
11480
11480
val reserve : t -> int -> unit
11481
- val push : elt -> t -> unit
11481
+ val push : t -> elt -> unit
11482
11482
val delete : t -> int -> unit
11483
11483
val pop : t -> unit
11484
11484
val get_last_and_pop : t -> elt
@@ -11859,7 +11859,7 @@ let init len f =
11859
11859
unsafe_blit d_arr 0 new_d_arr 0 d_len;
11860
11860
d.arr <- new_d_arr
11861
11861
11862
- let push v (d : t) =
11862
+ let push (d : t) v =
11863
11863
let d_len = d.len in
11864
11864
let d_arr = d.arr in
11865
11865
let d_arr_len = Array.length d_arr in
@@ -12110,17 +12110,17 @@ let suites =
12110
12110
let v = Int_vec.make 100 in
12111
12111
OUnit.assert_bool __LOC__
12112
12112
(not @@ Int_vec_util.mem 0 v) ;
12113
- Int_vec.push 0 v ;
12113
+ Int_vec.push v 0 ;
12114
12114
OUnit.assert_bool __LOC__
12115
12115
(Int_vec_util.mem 0 v )
12116
12116
end;
12117
12117
12118
12118
__LOC__ >:: begin fun _ ->
12119
12119
let u = Int_vec.make 100 in
12120
- Int_vec.push 1 u ;
12120
+ Int_vec.push u 1 ;
12121
12121
OUnit.assert_bool __LOC__
12122
12122
(not @@ Int_vec_util.mem 0 u );
12123
- Int_vec.push 0 u ;
12123
+ Int_vec.push u 0 ;
12124
12124
OUnit.assert_bool __LOC__
12125
12125
(Int_vec_util.mem 0 u)
12126
12126
end
@@ -14676,7 +14676,7 @@ let init len f =
14676
14676
unsafe_blit d_arr 0 new_d_arr 0 d_len;
14677
14677
d.arr <- new_d_arr
14678
14678
14679
- let push v (d : t) =
14679
+ let push (d : t) v =
14680
14680
let d_len = d.len in
14681
14681
let d_arr = d.arr in
14682
14682
let d_arr_len = Array.length d_arr in
@@ -15024,7 +15024,7 @@ let graph e =
15024
15024
let rec scc v_data =
15025
15025
let new_index = !index + 1 in
15026
15026
index := new_index ;
15027
- Int_vec.push v_data s ;
15027
+ Int_vec.push s v_data ;
15028
15028
15029
15029
index_array.(v_data) <- new_index ;
15030
15030
lowlink_array.(v_data) <- new_index ;
@@ -15059,7 +15059,7 @@ let graph e =
15059
15059
u := Int_vec.unsafe_get s !last_index
15060
15060
done ;
15061
15061
on_stack_array.(v_data) <- false; (* necessary *)
15062
- Int_vec_vec.push (Int_vec.get_and_delete_range s !last_index (s_len - !last_index)) output ;
15062
+ Int_vec_vec.push output (Int_vec.get_and_delete_range s !last_index (s_len - !last_index));
15063
15063
end
15064
15064
in
15065
15065
for i = 0 to node_numes - 1 do
@@ -15273,11 +15273,11 @@ let handle_lines tiny_test_cases =
15273
15273
(fun i -> Int_vec.empty () )
15274
15274
in
15275
15275
begin
15276
- rest |> List .iter (fun x ->
15276
+ Ext_list .iter rest (fun x ->
15277
15277
match Ext_string.split x ' ' with
15278
15278
| [ a ; b] ->
15279
15279
let a , b = int_of_string a , int_of_string b in
15280
- Int_vec.push b node_array.(a)
15280
+ Int_vec.push node_array.(a) b
15281
15281
| _ -> assert false
15282
15282
);
15283
15283
node_array
@@ -15295,7 +15295,7 @@ let read_file file =
15295
15295
begin match Ext_string.split x ' ' with
15296
15296
| [ a ; b] ->
15297
15297
let a , b = int_of_string a , int_of_string b in
15298
- Int_vec.push b node_array.(a)
15298
+ Int_vec.push node_array.(a) b
15299
15299
| _ -> (* assert false *) ()
15300
15300
end;
15301
15301
aux () in
@@ -15325,7 +15325,7 @@ let test (input : (string * string list) list) =
15325
15325
List.iter (fun (x,others) ->
15326
15326
let idx = String_hashtbl.find_exn tbl x in
15327
15327
others |>
15328
- List.iter (fun y -> Int_vec.push ( String_hashtbl.find_exn tbl y ) node_array.(idx ) )
15328
+ List.iter (fun y -> Int_vec.push node_array.(idx) ( String_hashtbl.find_exn tbl y ) )
15329
15329
) ;
15330
15330
Ext_scc.graph_check node_array
15331
15331
@@ -15353,7 +15353,7 @@ let test2 (input : (string * string list) list) =
15353
15353
List.iter (fun (x,others) ->
15354
15354
let idx = String_hashtbl.find_exn tbl x in
15355
15355
others |>
15356
- List.iter (fun y -> Int_vec.push ( String_hashtbl.find_exn tbl y ) node_array.(idx ) )
15356
+ List.iter (fun y -> Int_vec.push node_array.(idx) ( String_hashtbl.find_exn tbl y ) )
15357
15357
) ;
15358
15358
let output = Ext_scc.graph node_array in
15359
15359
output |> Int_vec_vec.map_into_array (fun int_vec -> Int_vec.map_into_array (fun i -> other_mapping.(i)) int_vec )
@@ -16236,7 +16236,7 @@ let handle graph =
16236
16236
let len = List.length graph in
16237
16237
let result = Ext_topsort.Edge_vec.make len in
16238
16238
List.iter (fun (id,deps) ->
16239
- Ext_topsort.Edge_vec.push {id ; deps = Int_vec.of_list deps } result
16239
+ Ext_topsort.Edge_vec.push result {id ; deps = Int_vec.of_list deps }
16240
16240
) graph;
16241
16241
result
16242
16242
@@ -19028,7 +19028,7 @@ let process_file file =
19028
19028
begin match Ext_string.quick_split_by_ws v with
19029
19029
| [a;b] ->
19030
19030
let a,b = int_of_string a , int_of_string b in
19031
- Int_vec_vec.push (Int_vec.of_array [|a;b|]) edges ;
19031
+ Int_vec_vec.push edges (Int_vec.of_array [|a;b|]);
19032
19032
| _ -> ()
19033
19033
end;
19034
19034
aux ((i+1) mod 10000);
@@ -19114,7 +19114,7 @@ let suites =
19114
19114
"inplace_filter " ^ __LOC__ >:: begin fun _ ->
19115
19115
v =~~ [|0; 1; 2; 3; 4; 5; 6; 7; 8; 9|];
19116
19116
19117
- ignore @@ Int_vec.push 32 v ;
19117
+ ignore @@ Int_vec.push v 32;
19118
19118
let capacity = Int_vec.capacity v in
19119
19119
v =~~ [|0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 32|];
19120
19120
Int_vec.inplace_filter (fun x -> x mod 2 = 0) v ;
@@ -19131,7 +19131,7 @@ let suites =
19131
19131
"inplace_filter_from " ^ __LOC__ >:: begin fun _ ->
19132
19132
let v = Int_vec.of_array (Array.init 10 (fun i -> i)) in
19133
19133
v =~~ [|0; 1; 2; 3; 4; 5; 6; 7; 8; 9|];
19134
- Int_vec.push 96 v ;
19134
+ Int_vec.push v 96 ;
19135
19135
Int_vec.inplace_filter_from 2 (fun x -> x mod 2 = 0) v ;
19136
19136
v =~~ [|0; 1; 2; 4; 6; 8; 96|];
19137
19137
Int_vec.inplace_filter_from 2 (fun x -> x mod 3 = 0) v ;
@@ -19188,17 +19188,17 @@ let suites =
19188
19188
let v = Int_vec.make 5 in
19189
19189
OUnit.assert_bool __LOC__
19190
19190
(try ignore @@ Int_vec.sub v 0 2 ; false with Invalid_argument _ -> true);
19191
- Int_vec.push 1 v ;
19191
+ Int_vec.push v 1 ;
19192
19192
OUnit.assert_bool __LOC__
19193
19193
(try ignore @@ Int_vec.sub v 0 2 ; false with Invalid_argument _ -> true);
19194
- Int_vec.push 2 v ;
19194
+ Int_vec.push v 2 ;
19195
19195
( Int_vec.sub v 0 2 =~~ [|1;2|])
19196
19196
end;
19197
19197
"reserve" ^ __LOC__ >:: begin fun _ ->
19198
19198
let v = Int_vec.empty () in
19199
19199
Int_vec.reserve v 1000 ;
19200
19200
for i = 0 to 900 do
19201
- Int_vec.push i v
19201
+ Int_vec.push v i
19202
19202
done ;
19203
19203
OUnit.assert_equal (Int_vec.length v) 901 ;
19204
19204
OUnit.assert_equal (Int_vec.capacity v) 1000
@@ -19207,23 +19207,23 @@ let suites =
19207
19207
let v = Int_vec.of_array [|3|] in
19208
19208
Int_vec.reserve v 10 ;
19209
19209
v =~~ [|3 |];
19210
- Int_vec.push 1 v ;
19211
- Int_vec.push 2 v ;
19212
- Int_vec.push 5 v ;
19210
+ Int_vec.push v 1 ;
19211
+ Int_vec.push v 2 ;
19212
+ Int_vec.push v 5 ;
19213
19213
v=~~ [|3;1;2;5|];
19214
19214
OUnit.assert_equal (Int_vec.capacity v ) 10 ;
19215
19215
for i = 0 to 5 do
19216
- Int_vec.push i v
19216
+ Int_vec.push v i
19217
19217
done;
19218
19218
v=~~ [|3;1;2;5;0;1;2;3;4;5|];
19219
- Int_vec.push 100 v ;
19219
+ Int_vec.push v 100;
19220
19220
v=~~[|3;1;2;5;0;1;2;3;4;5;100|];
19221
19221
OUnit.assert_equal (Int_vec.capacity v ) 20
19222
19222
end
19223
19223
;
19224
19224
__LOC__ >:: begin fun _ ->
19225
19225
let empty = Int_vec.empty () in
19226
- Int_vec.push 3 empty ;
19226
+ Int_vec.push empty 3 ;
19227
19227
empty =~~ [|3|];
19228
19228
19229
19229
end
@@ -19237,8 +19237,8 @@ let suites =
19237
19237
end;
19238
19238
__LOC__ >:: begin fun _ ->
19239
19239
let v = Int_vec.make 4 in
19240
- Int_vec.push 1 v ;
19241
- Int_vec.push 2 v ;
19240
+ Int_vec.push v 1 ;
19241
+ Int_vec.push v 2 ;
19242
19242
Int_vec.reverse_in_place v;
19243
19243
v =~~ [|2;1|]
19244
19244
end
0 commit comments