Skip to content

Commit b810c2b

Browse files
committed
flip the order
1 parent 951b1a8 commit b810c2b

14 files changed

+69
-69
lines changed

jscomp/bin/all_ounit_tests.ml

+28-28
Original file line numberDiff line numberDiff line change
@@ -11478,7 +11478,7 @@ sig
1147811478
*)
1147911479
val unsafe_internal_array : t -> elt array
1148011480
val reserve : t -> int -> unit
11481-
val push : elt -> t -> unit
11481+
val push : t -> elt -> unit
1148211482
val delete : t -> int -> unit
1148311483
val pop : t -> unit
1148411484
val get_last_and_pop : t -> elt
@@ -11859,7 +11859,7 @@ let init len f =
1185911859
unsafe_blit d_arr 0 new_d_arr 0 d_len;
1186011860
d.arr <- new_d_arr
1186111861

11862-
let push v (d : t) =
11862+
let push (d : t) v =
1186311863
let d_len = d.len in
1186411864
let d_arr = d.arr in
1186511865
let d_arr_len = Array.length d_arr in
@@ -12110,17 +12110,17 @@ let suites =
1211012110
let v = Int_vec.make 100 in
1211112111
OUnit.assert_bool __LOC__
1211212112
(not @@ Int_vec_util.mem 0 v) ;
12113-
Int_vec.push 0 v ;
12113+
Int_vec.push v 0;
1211412114
OUnit.assert_bool __LOC__
1211512115
(Int_vec_util.mem 0 v )
1211612116
end;
1211712117

1211812118
__LOC__ >:: begin fun _ ->
1211912119
let u = Int_vec.make 100 in
12120-
Int_vec.push 1 u ;
12120+
Int_vec.push u 1;
1212112121
OUnit.assert_bool __LOC__
1212212122
(not @@ Int_vec_util.mem 0 u );
12123-
Int_vec.push 0 u ;
12123+
Int_vec.push u 0;
1212412124
OUnit.assert_bool __LOC__
1212512125
(Int_vec_util.mem 0 u)
1212612126
end
@@ -14676,7 +14676,7 @@ let init len f =
1467614676
unsafe_blit d_arr 0 new_d_arr 0 d_len;
1467714677
d.arr <- new_d_arr
1467814678

14679-
let push v (d : t) =
14679+
let push (d : t) v =
1468014680
let d_len = d.len in
1468114681
let d_arr = d.arr in
1468214682
let d_arr_len = Array.length d_arr in
@@ -15024,7 +15024,7 @@ let graph e =
1502415024
let rec scc v_data =
1502515025
let new_index = !index + 1 in
1502615026
index := new_index ;
15027-
Int_vec.push v_data s ;
15027+
Int_vec.push s v_data;
1502815028

1502915029
index_array.(v_data) <- new_index ;
1503015030
lowlink_array.(v_data) <- new_index ;
@@ -15059,7 +15059,7 @@ let graph e =
1505915059
u := Int_vec.unsafe_get s !last_index
1506015060
done ;
1506115061
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));
1506315063
end
1506415064
in
1506515065
for i = 0 to node_numes - 1 do
@@ -15273,11 +15273,11 @@ let handle_lines tiny_test_cases =
1527315273
(fun i -> Int_vec.empty () )
1527415274
in
1527515275
begin
15276-
rest |> List.iter (fun x ->
15276+
Ext_list.iter rest (fun x ->
1527715277
match Ext_string.split x ' ' with
1527815278
| [ a ; b] ->
1527915279
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
1528115281
| _ -> assert false
1528215282
);
1528315283
node_array
@@ -15295,7 +15295,7 @@ let read_file file =
1529515295
begin match Ext_string.split x ' ' with
1529615296
| [ a ; b] ->
1529715297
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
1529915299
| _ -> (* assert false *) ()
1530015300
end;
1530115301
aux () in
@@ -15325,7 +15325,7 @@ let test (input : (string * string list) list) =
1532515325
List.iter (fun (x,others) ->
1532615326
let idx = String_hashtbl.find_exn tbl x in
1532715327
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 ) )
1532915329
) ;
1533015330
Ext_scc.graph_check node_array
1533115331

@@ -15353,7 +15353,7 @@ let test2 (input : (string * string list) list) =
1535315353
List.iter (fun (x,others) ->
1535415354
let idx = String_hashtbl.find_exn tbl x in
1535515355
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 ) )
1535715357
) ;
1535815358
let output = Ext_scc.graph node_array in
1535915359
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 =
1623616236
let len = List.length graph in
1623716237
let result = Ext_topsort.Edge_vec.make len in
1623816238
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 }
1624016240
) graph;
1624116241
result
1624216242

@@ -19028,7 +19028,7 @@ let process_file file =
1902819028
begin match Ext_string.quick_split_by_ws v with
1902919029
| [a;b] ->
1903019030
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|]);
1903219032
| _ -> ()
1903319033
end;
1903419034
aux ((i+1) mod 10000);
@@ -19114,7 +19114,7 @@ let suites =
1911419114
"inplace_filter " ^ __LOC__ >:: begin fun _ ->
1911519115
v =~~ [|0; 1; 2; 3; 4; 5; 6; 7; 8; 9|];
1911619116

19117-
ignore @@ Int_vec.push 32 v;
19117+
ignore @@ Int_vec.push v 32;
1911819118
let capacity = Int_vec.capacity v in
1911919119
v =~~ [|0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 32|];
1912019120
Int_vec.inplace_filter (fun x -> x mod 2 = 0) v ;
@@ -19131,7 +19131,7 @@ let suites =
1913119131
"inplace_filter_from " ^ __LOC__ >:: begin fun _ ->
1913219132
let v = Int_vec.of_array (Array.init 10 (fun i -> i)) in
1913319133
v =~~ [|0; 1; 2; 3; 4; 5; 6; 7; 8; 9|];
19134-
Int_vec.push 96 v ;
19134+
Int_vec.push v 96 ;
1913519135
Int_vec.inplace_filter_from 2 (fun x -> x mod 2 = 0) v ;
1913619136
v =~~ [|0; 1; 2; 4; 6; 8; 96|];
1913719137
Int_vec.inplace_filter_from 2 (fun x -> x mod 3 = 0) v ;
@@ -19188,17 +19188,17 @@ let suites =
1918819188
let v = Int_vec.make 5 in
1918919189
OUnit.assert_bool __LOC__
1919019190
(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;
1919219192
OUnit.assert_bool __LOC__
1919319193
(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;
1919519195
( Int_vec.sub v 0 2 =~~ [|1;2|])
1919619196
end;
1919719197
"reserve" ^ __LOC__ >:: begin fun _ ->
1919819198
let v = Int_vec.empty () in
1919919199
Int_vec.reserve v 1000 ;
1920019200
for i = 0 to 900 do
19201-
Int_vec.push i v
19201+
Int_vec.push v i
1920219202
done ;
1920319203
OUnit.assert_equal (Int_vec.length v) 901 ;
1920419204
OUnit.assert_equal (Int_vec.capacity v) 1000
@@ -19207,23 +19207,23 @@ let suites =
1920719207
let v = Int_vec.of_array [|3|] in
1920819208
Int_vec.reserve v 10 ;
1920919209
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;
1921319213
v=~~ [|3;1;2;5|];
1921419214
OUnit.assert_equal (Int_vec.capacity v ) 10 ;
1921519215
for i = 0 to 5 do
19216-
Int_vec.push i v
19216+
Int_vec.push v i
1921719217
done;
1921819218
v=~~ [|3;1;2;5;0;1;2;3;4;5|];
19219-
Int_vec.push 100 v;
19219+
Int_vec.push v 100;
1922019220
v=~~[|3;1;2;5;0;1;2;3;4;5;100|];
1922119221
OUnit.assert_equal (Int_vec.capacity v ) 20
1922219222
end
1922319223
;
1922419224
__LOC__ >:: begin fun _ ->
1922519225
let empty = Int_vec.empty () in
19226-
Int_vec.push 3 empty;
19226+
Int_vec.push empty 3;
1922719227
empty =~~ [|3|];
1922819228

1922919229
end
@@ -19237,8 +19237,8 @@ let suites =
1923719237
end;
1923819238
__LOC__ >:: begin fun _ ->
1923919239
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;
1924219242
Int_vec.reverse_in_place v;
1924319243
v =~~ [|2;1|]
1924419244
end

jscomp/bin/bsb_native.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7517,7 +7517,7 @@ sig
75177517
*)
75187518
val unsafe_internal_array : t -> elt array
75197519
val reserve : t -> int -> unit
7520-
val push : elt -> t -> unit
7520+
val push : t -> elt -> unit
75217521
val delete : t -> int -> unit
75227522
val pop : t -> unit
75237523
val get_last_and_pop : t -> elt
@@ -7903,7 +7903,7 @@ let init len f =
79037903
unsafe_blit d_arr 0 new_d_arr 0 d_len;
79047904
d.arr <- new_d_arr
79057905

7906-
let push v (d : t) =
7906+
let push (d : t) v =
79077907
let d_len = d.len in
79087908
let d_arr = d.arr in
79097909
let d_arr_len = Array.length d_arr in
@@ -9662,7 +9662,7 @@ let handle_empty_sources
96629662
match Ext_string.is_valid_source_name name with
96639663
| Good -> begin
96649664
let new_acc = Bsb_db.collect_module_by_filename ~dir acc name in
9665-
String_vec.push name dyn_file_array ;
9665+
String_vec.push dyn_file_array name;
96669666
new_acc
96679667
end
96689668
| Invalid_module_name ->

jscomp/bsb/bsb_parse_sources.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ let handle_empty_sources
120120
match Ext_string.is_valid_source_name name with
121121
| Good -> begin
122122
let new_acc = Bsb_db.collect_module_by_filename ~dir acc name in
123-
String_vec.push name dyn_file_array ;
123+
String_vec.push dyn_file_array name;
124124
new_acc
125125
end
126126
| Invalid_module_name ->

jscomp/core/lam_scc.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ let preprocess_deps (groups : bindings) : _ * Ident.t array * Int_vec.t array
110110
if hit then
111111
begin
112112
let key = Ordered_hash_map_local_ident.rank domain ident in
113-
Int_vec.push key base_key;
113+
Int_vec.push base_key key;
114114
end
115115
);
116116

jscomp/ext/ext_scc.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let graph e =
5050
let rec scc v_data =
5151
let new_index = !index + 1 in
5252
index := new_index ;
53-
Int_vec.push v_data s ;
53+
Int_vec.push s v_data;
5454

5555
index_array.(v_data) <- new_index ;
5656
lowlink_array.(v_data) <- new_index ;
@@ -85,7 +85,7 @@ let graph e =
8585
u := Int_vec.unsafe_get s !last_index
8686
done ;
8787
on_stack_array.(v_data) <- false; (* necessary *)
88-
Int_vec_vec.push (Int_vec.get_and_delete_range s !last_index (s_len - !last_index)) output;
88+
Int_vec_vec.push output (Int_vec.get_and_delete_range s !last_index (s_len - !last_index));
8989
end
9090
in
9191
for i = 0 to node_numes - 1 do

jscomp/ext/vec.cppo.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ let init len f =
319319
unsafe_blit d_arr 0 new_d_arr 0 d_len;
320320
d.arr <- new_d_arr
321321

322-
let push v (d : t) =
322+
let push (d : t) v =
323323
let d_len = d.len in
324324
let d_arr = d.arr in
325325
let d_arr_len = Array.length d_arr in

jscomp/ext/vec_gen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sig
4848
*)
4949
val unsafe_internal_array : t -> elt array
5050
val reserve : t -> int -> unit
51-
val push : elt -> t -> unit
51+
val push : t -> elt -> unit
5252
val delete : t -> int -> unit
5353
val pop : t -> unit
5454
val get_last_and_pop : t -> elt

jscomp/ounit_tests/ounit_int_vec_tests.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ let suites =
1616
let v = Int_vec.make 100 in
1717
OUnit.assert_bool __LOC__
1818
(not @@ Int_vec_util.mem 0 v) ;
19-
Int_vec.push 0 v ;
19+
Int_vec.push v 0;
2020
OUnit.assert_bool __LOC__
2121
(Int_vec_util.mem 0 v )
2222
end;
2323

2424
__LOC__ >:: begin fun _ ->
2525
let u = Int_vec.make 100 in
26-
Int_vec.push 1 u ;
26+
Int_vec.push u 1;
2727
OUnit.assert_bool __LOC__
2828
(not @@ Int_vec_util.mem 0 u );
29-
Int_vec.push 0 u ;
29+
Int_vec.push u 0;
3030
OUnit.assert_bool __LOC__
3131
(Int_vec_util.mem 0 u)
3232
end

jscomp/ounit_tests/ounit_scc_tests.ml

+5-5
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ let handle_lines tiny_test_cases =
195195
(fun i -> Int_vec.empty () )
196196
in
197197
begin
198-
rest |> List.iter (fun x ->
198+
Ext_list.iter rest (fun x ->
199199
match Ext_string.split x ' ' with
200200
| [ a ; b] ->
201201
let a , b = int_of_string a , int_of_string b in
202-
Int_vec.push b node_array.(a)
202+
Int_vec.push node_array.(a) b
203203
| _ -> assert false
204204
);
205205
node_array
@@ -217,7 +217,7 @@ let read_file file =
217217
begin match Ext_string.split x ' ' with
218218
| [ a ; b] ->
219219
let a , b = int_of_string a , int_of_string b in
220-
Int_vec.push b node_array.(a)
220+
Int_vec.push node_array.(a) b
221221
| _ -> (* assert false *) ()
222222
end;
223223
aux () in
@@ -247,7 +247,7 @@ let test (input : (string * string list) list) =
247247
List.iter (fun (x,others) ->
248248
let idx = String_hashtbl.find_exn tbl x in
249249
others |>
250-
List.iter (fun y -> Int_vec.push (String_hashtbl.find_exn tbl y ) node_array.(idx) )
250+
List.iter (fun y -> Int_vec.push node_array.(idx) (String_hashtbl.find_exn tbl y ) )
251251
) ;
252252
Ext_scc.graph_check node_array
253253

@@ -275,7 +275,7 @@ let test2 (input : (string * string list) list) =
275275
List.iter (fun (x,others) ->
276276
let idx = String_hashtbl.find_exn tbl x in
277277
others |>
278-
List.iter (fun y -> Int_vec.push (String_hashtbl.find_exn tbl y ) node_array.(idx) )
278+
List.iter (fun y -> Int_vec.push node_array.(idx) (String_hashtbl.find_exn tbl y ) )
279279
) ;
280280
let output = Ext_scc.graph node_array in
281281
output |> Int_vec_vec.map_into_array (fun int_vec -> Int_vec.map_into_array (fun i -> other_mapping.(i)) int_vec )

jscomp/ounit_tests/ounit_topsort_tests.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let handle graph =
55
let len = List.length graph in
66
let result = Ext_topsort.Edge_vec.make len in
77
List.iter (fun (id,deps) ->
8-
Ext_topsort.Edge_vec.push {id ; deps = Int_vec.of_list deps } result
8+
Ext_topsort.Edge_vec.push result {id ; deps = Int_vec.of_list deps }
99
) graph;
1010
result
1111

jscomp/ounit_tests/ounit_union_find_tests.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ let process_file file =
950950
begin match Ext_string.quick_split_by_ws v with
951951
| [a;b] ->
952952
let a,b = int_of_string a , int_of_string b in
953-
Int_vec_vec.push (Int_vec.of_array [|a;b|]) edges;
953+
Int_vec_vec.push edges (Int_vec.of_array [|a;b|]);
954954
| _ -> ()
955955
end;
956956
aux ((i+1) mod 10000);

0 commit comments

Comments
 (0)