Skip to content

Commit fa0c6c5

Browse files
committed
Tweak
1 parent 7bcbaf6 commit fa0c6c5

17 files changed

+71
-71
lines changed

jscomp/bin/all_ounit_tests.ml

+7-7
Original file line numberDiff line numberDiff line change
@@ -8383,7 +8383,7 @@ let copy h = { h with data = Array.copy h.data }
83838383

83848384
let length h = h.size
83858385

8386-
let iter f h =
8386+
let iter h f =
83878387
let rec do_bucket = function
83888388
| [ ] ->
83898389
()
@@ -8483,8 +8483,8 @@ sig
84838483
val add : t -> key -> unit
84848484
val of_array : key array -> t
84858485
val check_add : t -> key -> bool
8486-
val mem : t -> key -> bool
8487-
val iter: (key -> unit) -> t -> unit
8486+
val mem : t -> key -> bool
8487+
val iter: t -> (key -> unit) -> unit
84888488
val fold: (key -> 'b -> 'b) -> t -> 'b -> 'b
84898489
val length: t -> int
84908490
val stats: t -> Hashtbl.statistics
@@ -8675,7 +8675,7 @@ val remove : 'a t -> 'a -> unit
86758675

86768676
val mem : 'a t -> 'a -> bool
86778677

8678-
val iter : ('a -> unit) -> 'a t -> unit
8678+
val iter : 'a t -> ('a -> unit) -> unit
86798679

86808680
val elements : 'a t -> 'a list
86818681

@@ -9677,7 +9677,7 @@ module type S = sig
96779677

96789678
val replace: 'a t -> key -> 'a -> unit
96799679
val mem: 'a t -> key -> bool
9680-
val iter: (key -> 'a -> unit) -> 'a t -> unit
9680+
val iter: 'a t -> (key -> 'a -> unit) -> unit
96819681
val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
96829682
val length: 'a t -> int
96839683
val stats: 'a t -> Hashtbl.statistics
@@ -9739,7 +9739,7 @@ let resize indexfun h =
97399739

97409740

97419741

9742-
let iter f h =
9742+
let iter h f =
97439743
let rec do_bucket = function
97449744
| Empty ->
97459745
()
@@ -15287,7 +15287,7 @@ let test2 (input : (string * string list) list) =
1528715287
(fun (x,others) -> List.iter add (x::others));
1528815288
let nodes_num = String_hashtbl.length tbl in
1528915289
let other_mapping = Array.make nodes_num "" in
15290-
String_hashtbl.iter (fun k v -> other_mapping.(v) <- k ) tbl ;
15290+
String_hashtbl.iter tbl (fun k v -> other_mapping.(v) <- k ) ;
1529115291

1529215292
let node_array =
1529315293
Array.init nodes_num

jscomp/bin/bsb_native.ml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4304,7 +4304,7 @@ module type S = sig
43044304

43054305
val replace: 'a t -> key -> 'a -> unit
43064306
val mem: 'a t -> key -> bool
4307-
val iter: (key -> 'a -> unit) -> 'a t -> unit
4307+
val iter: 'a t -> (key -> 'a -> unit) -> unit
43084308
val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
43094309
val length: 'a t -> int
43104310
val stats: 'a t -> Hashtbl.statistics
@@ -4366,7 +4366,7 @@ let resize indexfun h =
43664366

43674367

43684368

4369-
let iter f h =
4369+
let iter h f =
43704370
let rec do_bucket = function
43714371
| Empty ->
43724372
()
@@ -10794,7 +10794,7 @@ let copy h = { h with data = Array.copy h.data }
1079410794

1079510795
let length h = h.size
1079610796

10797-
let iter f h =
10797+
let iter h f =
1079810798
let rec do_bucket = function
1079910799
| [ ] ->
1080010800
()
@@ -10894,8 +10894,8 @@ sig
1089410894
val add : t -> key -> unit
1089510895
val of_array : key array -> t
1089610896
val check_add : t -> key -> bool
10897-
val mem : t -> key -> bool
10898-
val iter: (key -> unit) -> t -> unit
10897+
val mem : t -> key -> bool
10898+
val iter: t -> (key -> unit) -> unit
1089910899
val fold: (key -> 'b -> 'b) -> t -> 'b -> 'b
1090010900
val length: t -> int
1090110901
val stats: t -> Hashtbl.statistics
@@ -16800,7 +16800,7 @@ let install_targets cwd (config : Bsb_config_types.t option) =
1680016800
| Some x ->
1680116801
install_filename_sans_extension destdir None x
1680216802
end;
16803-
String_hash_set.iter (install_filename_sans_extension destdir namespace) files_to_install;
16803+
String_hash_set.iter files_to_install (install_filename_sans_extension destdir namespace) ;
1680416804
Bsb_log.info "@{<info>Installing finished@} @.";
1680516805
end
1680616806

jscomp/bin/bspack.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8059,7 +8059,7 @@ module type S = sig
80598059

80608060
val replace: 'a t -> key -> 'a -> unit
80618061
val mem: 'a t -> key -> bool
8062-
val iter: (key -> 'a -> unit) -> 'a t -> unit
8062+
val iter: 'a t -> (key -> 'a -> unit) -> unit
80638063
val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
80648064
val length: 'a t -> int
80658065
val stats: 'a t -> Hashtbl.statistics
@@ -8121,7 +8121,7 @@ let resize indexfun h =
81218121

81228122

81238123

8124-
let iter f h =
8124+
let iter h f =
81258125
let rec do_bucket = function
81268126
| Empty ->
81278127
()

jscomp/bsb/bsb_world.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ let install_targets cwd (config : Bsb_config_types.t option) =
6464
| Some x ->
6565
install_filename_sans_extension destdir None x
6666
end;
67-
String_hash_set.iter (install_filename_sans_extension destdir namespace) files_to_install;
67+
String_hash_set.iter files_to_install (install_filename_sans_extension destdir namespace) ;
6868
Bsb_log.info "@{<info>Installing finished@} @.";
6969
end
7070

jscomp/core/js_pass_flatten_and_mark_dead.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ let mark_dead = object (self)
106106
Js_op_util.update_used_stats ident_info
107107
(if b then Scanning_pure else Scanning_non_pure)
108108
method promote_dead =
109-
Ident_hashtbl.iter (fun _id (info : [`Info of J.ident_info | `Recursive]) ->
109+
Ident_hashtbl.iter ident_use_stats (fun _id (info : [`Info of J.ident_info | `Recursive]) ->
110110
match info with
111111
| `Info ({used_stats = Scanning_pure} as info) ->
112112
Js_op_util.update_used_stats info Dead_pure
113113
| `Info ({used_stats = Scanning_non_pure} as info) ->
114114
Js_op_util.update_used_stats info Dead_non_pure
115115
| _ -> ())
116-
ident_use_stats;
116+
;
117117
Ident_hashtbl.clear ident_use_stats (* clear to make it re-entrant *)
118118

119119
method! program x =

jscomp/core/js_pass_tailcall_inline.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ let count_collects () =
7777
-> self#expression x
7878
method! ident id = self#add_use id; self
7979
method get_stats =
80-
Ident_hashtbl.iter (fun ident (v : J.variable_declaration) ->
80+
Ident_hashtbl.iter defined_idents (fun ident v ->
8181
if Ident_set.mem export_set ident then
8282
Js_op_util.update_used_stats v.ident_info Exported
8383
else
@@ -93,7 +93,7 @@ let count_collects () =
9393
if !num = 1 then
9494
Js_op_util.update_used_stats v.ident_info
9595
(if pure then Once_pure else Used)
96-
) defined_idents; defined_idents
96+
) ; defined_idents
9797
end
9898

9999

jscomp/core/lam_compile_env.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ let get_required_modules
284284
extras
285285
(hard_dependencies
286286
: Lam_module_ident.Hash_set.t) : Lam_module_ident.t list =
287-
Lam_module_ident.Hash.iter (fun id _ ->
287+
Lam_module_ident.Hash.iter cached_tbl (fun id _ ->
288288
if not @@ is_pure_module id
289-
then add hard_dependencies id) cached_tbl ;
290-
Lam_module_ident.Hash_set.iter (fun id ->
289+
then add hard_dependencies id);
290+
Lam_module_ident.Hash_set.iter extras (fun id ->
291291
(if not @@ is_pure_module id
292292
then add hard_dependencies id : unit)
293-
) extras;
293+
);
294294
Lam_module_ident.Hash_set.elements hard_dependencies

jscomp/core/lam_pass_count.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ let pp_info fmt (x : used_info) =
4040
Format.fprintf fmt "(<captured:%b>:%d)" x.captured x.times
4141

4242
let pp_occ_tbl fmt tbl =
43-
Ident_hashtbl.iter (fun k v ->
43+
Ident_hashtbl.iter tbl (fun k v ->
4444
Format.fprintf fmt "@[%a@ %a@]@." Ident.print k pp_info v
45-
) tbl
45+
)
4646
(* The global table [occ] associates to each let-bound identifier
4747
the number of its uses (as a reference):
4848
- 0 if never used

jscomp/core/lam_stats.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ type t = {
7070
let pp = Format.fprintf
7171

7272
let pp_alias_tbl fmt (tbl : alias_tbl) =
73-
Ident_hashtbl.iter (fun k v -> pp fmt "@[%a -> %a@]@." Ident.print k Ident.print v)
74-
tbl
73+
Ident_hashtbl.iter tbl (fun k v -> pp fmt "@[%a -> %a@]@." Ident.print k Ident.print v)
74+
7575

7676

7777

7878
let pp_ident_tbl fmt (ident_tbl : ident_tbl) =
79-
Ident_hashtbl.iter (fun k v -> pp fmt "@[%a -> %a@]@."
79+
Ident_hashtbl.iter ident_tbl (fun k v -> pp fmt "@[%a -> %a@]@."
8080
Ident.print k Lam_id_kind.print v)
81-
ident_tbl
81+
8282

8383
let print fmt (v : t) =
8484
pp fmt "@[Alias table:@ @[%a@]@]" pp_alias_tbl v.alias_tbl ;

jscomp/ext/hash_set_gen.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ let copy h = { h with data = Array.copy h.data }
5555

5656
let length h = h.size
5757

58-
let iter f h =
58+
let iter h f =
5959
let rec do_bucket = function
6060
| [ ] ->
6161
()
@@ -155,8 +155,8 @@ sig
155155
val add : t -> key -> unit
156156
val of_array : key array -> t
157157
val check_add : t -> key -> bool
158-
val mem : t -> key -> bool
159-
val iter: (key -> unit) -> t -> unit
158+
val mem : t -> key -> bool
159+
val iter: t -> (key -> unit) -> unit
160160
val fold: (key -> 'b -> 'b) -> t -> 'b -> 'b
161161
val length: t -> int
162162
val stats: t -> Hashtbl.statistics

jscomp/ext/hash_set_poly.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ val remove : 'a t -> 'a -> unit
3838

3939
val mem : 'a t -> 'a -> bool
4040

41-
val iter : ('a -> unit) -> 'a t -> unit
41+
val iter : 'a t -> ('a -> unit) -> unit
4242

4343
val elements : 'a t -> 'a list
4444

jscomp/ext/hashtbl_gen.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module type S = sig
4040

4141
val replace: 'a t -> key -> 'a -> unit
4242
val mem: 'a t -> key -> bool
43-
val iter: (key -> 'a -> unit) -> 'a t -> unit
43+
val iter: 'a t -> (key -> 'a -> unit) -> unit
4444
val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
4545
val length: 'a t -> int
4646
val stats: 'a t -> Hashtbl.statistics
@@ -102,7 +102,7 @@ let resize indexfun h =
102102

103103

104104

105-
let iter f h =
105+
let iter h f =
106106
let rec do_bucket = function
107107
| Empty ->
108108
()

jscomp/ounit_tests/ounit_scc_tests.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ let test2 (input : (string * string list) list) =
266266
(fun (x,others) -> List.iter add (x::others));
267267
let nodes_num = String_hashtbl.length tbl in
268268
let other_mapping = Array.make nodes_num "" in
269-
String_hashtbl.iter (fun k v -> other_mapping.(v) <- k ) tbl ;
269+
String_hashtbl.iter tbl (fun k v -> other_mapping.(v) <- k ) ;
270270

271271
let node_array =
272272
Array.init nodes_num

lib/bsb.ml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4304,7 +4304,7 @@ module type S = sig
43044304

43054305
val replace: 'a t -> key -> 'a -> unit
43064306
val mem: 'a t -> key -> bool
4307-
val iter: (key -> 'a -> unit) -> 'a t -> unit
4307+
val iter: 'a t -> (key -> 'a -> unit) -> unit
43084308
val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
43094309
val length: 'a t -> int
43104310
val stats: 'a t -> Hashtbl.statistics
@@ -4366,7 +4366,7 @@ let resize indexfun h =
43664366

43674367

43684368

4369-
let iter f h =
4369+
let iter h f =
43704370
let rec do_bucket = function
43714371
| Empty ->
43724372
()
@@ -10794,7 +10794,7 @@ let copy h = { h with data = Array.copy h.data }
1079410794

1079510795
let length h = h.size
1079610796

10797-
let iter f h =
10797+
let iter h f =
1079810798
let rec do_bucket = function
1079910799
| [ ] ->
1080010800
()
@@ -10894,8 +10894,8 @@ sig
1089410894
val add : t -> key -> unit
1089510895
val of_array : key array -> t
1089610896
val check_add : t -> key -> bool
10897-
val mem : t -> key -> bool
10898-
val iter: (key -> unit) -> t -> unit
10897+
val mem : t -> key -> bool
10898+
val iter: t -> (key -> unit) -> unit
1089910899
val fold: (key -> 'b -> 'b) -> t -> 'b -> 'b
1090010900
val length: t -> int
1090110901
val stats: t -> Hashtbl.statistics
@@ -16800,7 +16800,7 @@ let install_targets cwd (config : Bsb_config_types.t option) =
1680016800
| Some x ->
1680116801
install_filename_sans_extension destdir None x
1680216802
end;
16803-
String_hash_set.iter (install_filename_sans_extension destdir namespace) files_to_install;
16803+
String_hash_set.iter files_to_install (install_filename_sans_extension destdir namespace) ;
1680416804
Bsb_log.info "@{<info>Installing finished@} @.";
1680516805
end
1680616806

lib/bsdep.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -29939,7 +29939,7 @@ let copy h = { h with data = Array.copy h.data }
2993929939

2994029940
let length h = h.size
2994129941

29942-
let iter f h =
29942+
let iter h f =
2994329943
let rec do_bucket = function
2994429944
| [ ] ->
2994529945
()
@@ -30039,8 +30039,8 @@ sig
3003930039
val add : t -> key -> unit
3004030040
val of_array : key array -> t
3004130041
val check_add : t -> key -> bool
30042-
val mem : t -> key -> bool
30043-
val iter: (key -> unit) -> t -> unit
30042+
val mem : t -> key -> bool
30043+
val iter: t -> (key -> unit) -> unit
3004430044
val fold: (key -> 'b -> 'b) -> t -> 'b -> 'b
3004530045
val length: t -> int
3004630046
val stats: t -> Hashtbl.statistics
@@ -30090,7 +30090,7 @@ val remove : 'a t -> 'a -> unit
3009030090

3009130091
val mem : 'a t -> 'a -> bool
3009230092

30093-
val iter : ('a -> unit) -> 'a t -> unit
30093+
val iter : 'a t -> ('a -> unit) -> unit
3009430094

3009530095
val elements : 'a t -> 'a list
3009630096

lib/bsppx.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11877,7 +11877,7 @@ let copy h = { h with data = Array.copy h.data }
1187711877

1187811878
let length h = h.size
1187911879

11880-
let iter f h =
11880+
let iter h f =
1188111881
let rec do_bucket = function
1188211882
| [ ] ->
1188311883
()
@@ -11977,8 +11977,8 @@ sig
1197711977
val add : t -> key -> unit
1197811978
val of_array : key array -> t
1197911979
val check_add : t -> key -> bool
11980-
val mem : t -> key -> bool
11981-
val iter: (key -> unit) -> t -> unit
11980+
val mem : t -> key -> bool
11981+
val iter: t -> (key -> unit) -> unit
1198211982
val fold: (key -> 'b -> 'b) -> t -> 'b -> 'b
1198311983
val length: t -> int
1198411984
val stats: t -> Hashtbl.statistics
@@ -12028,7 +12028,7 @@ val remove : 'a t -> 'a -> unit
1202812028

1202912029
val mem : 'a t -> 'a -> bool
1203012030

12031-
val iter : ('a -> unit) -> 'a t -> unit
12031+
val iter : 'a t -> ('a -> unit) -> unit
1203212032

1203312033
val elements : 'a t -> 'a list
1203412034

0 commit comments

Comments
 (0)