Skip to content

Commit db78d91

Browse files
committed
clean up another unneeded reducer -> use iterator in the future
1 parent 310d9b3 commit db78d91

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

jscomp/core/js_fold_basic.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@
2727

2828
let add_lam_module_ident = Lam_module_ident.Hash_set.add
2929
let create = Lam_module_ident.Hash_set.create
30-
class count_hard_dependencies =
30+
class count_hard_dependencies hard_dependencies =
3131
object(self : 'self_type)
3232
inherit Js_fold.fold as super
33-
val hard_dependencies = create 17
3433
method! module_id vid =
3534
add_lam_module_ident hard_dependencies vid; self
3635
method! expression x : 'self_type =
@@ -42,11 +41,12 @@ class count_hard_dependencies =
4241
id)
4342
| _ -> ());
4443
super#expression x
45-
method get_hard_dependencies = hard_dependencies
4644
end
4745

4846
let calculate_hard_dependencies block =
49-
((new count_hard_dependencies)#block block) # get_hard_dependencies
47+
let hard_dependencies = create 17 in
48+
let _ : Js_fold.fold = (new count_hard_dependencies hard_dependencies)#block block in
49+
hard_dependencies
5050

5151
(*
5252
Given a set of [variables], count which variables [lam] will depend on

lib/4.06.1/unstable/js_compiler.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -99248,10 +99248,9 @@ end = struct
9924899248

9924999249
let add_lam_module_ident = Lam_module_ident.Hash_set.add
9925099250
let create = Lam_module_ident.Hash_set.create
99251-
class count_hard_dependencies =
99251+
class count_hard_dependencies hard_dependencies =
9925299252
object(self : 'self_type)
9925399253
inherit Js_fold.fold as super
99254-
val hard_dependencies = create 17
9925599254
method! module_id vid =
9925699255
add_lam_module_ident hard_dependencies vid; self
9925799256
method! expression x : 'self_type =
@@ -99263,11 +99262,12 @@ class count_hard_dependencies =
9926399262
id)
9926499263
| _ -> ());
9926599264
super#expression x
99266-
method get_hard_dependencies = hard_dependencies
9926799265
end
9926899266

9926999267
let calculate_hard_dependencies block =
99270-
((new count_hard_dependencies)#block block) # get_hard_dependencies
99268+
let hard_dependencies = create 17 in
99269+
let _ : Js_fold.fold = (new count_hard_dependencies hard_dependencies)#block block in
99270+
hard_dependencies
9927199271

9927299272
(*
9927399273
Given a set of [variables], count which variables [lam] will depend on

lib/4.06.1/unstable/js_refmt_compiler.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -99248,10 +99248,9 @@ end = struct
9924899248

9924999249
let add_lam_module_ident = Lam_module_ident.Hash_set.add
9925099250
let create = Lam_module_ident.Hash_set.create
99251-
class count_hard_dependencies =
99251+
class count_hard_dependencies hard_dependencies =
9925299252
object(self : 'self_type)
9925399253
inherit Js_fold.fold as super
99254-
val hard_dependencies = create 17
9925599254
method! module_id vid =
9925699255
add_lam_module_ident hard_dependencies vid; self
9925799256
method! expression x : 'self_type =
@@ -99263,11 +99262,12 @@ class count_hard_dependencies =
9926399262
id)
9926499263
| _ -> ());
9926599264
super#expression x
99266-
method get_hard_dependencies = hard_dependencies
9926799265
end
9926899266

9926999267
let calculate_hard_dependencies block =
99270-
((new count_hard_dependencies)#block block) # get_hard_dependencies
99268+
let hard_dependencies = create 17 in
99269+
let _ : Js_fold.fold = (new count_hard_dependencies hard_dependencies)#block block in
99270+
hard_dependencies
9927199271

9927299272
(*
9927399273
Given a set of [variables], count which variables [lam] will depend on

lib/4.06.1/whole_compiler.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -381730,10 +381730,9 @@ end = struct
381730381730

381731381731
let add_lam_module_ident = Lam_module_ident.Hash_set.add
381732381732
let create = Lam_module_ident.Hash_set.create
381733-
class count_hard_dependencies =
381733+
class count_hard_dependencies hard_dependencies =
381734381734
object(self : 'self_type)
381735381735
inherit Js_fold.fold as super
381736-
val hard_dependencies = create 17
381737381736
method! module_id vid =
381738381737
add_lam_module_ident hard_dependencies vid; self
381739381738
method! expression x : 'self_type =
@@ -381745,11 +381744,12 @@ class count_hard_dependencies =
381745381744
id)
381746381745
| _ -> ());
381747381746
super#expression x
381748-
method get_hard_dependencies = hard_dependencies
381749381747
end
381750381748

381751381749
let calculate_hard_dependencies block =
381752-
((new count_hard_dependencies)#block block) # get_hard_dependencies
381750+
let hard_dependencies = create 17 in
381751+
let _ : Js_fold.fold = (new count_hard_dependencies hard_dependencies)#block block in
381752+
hard_dependencies
381753381753

381754381754
(*
381755381755
Given a set of [variables], count which variables [lam] will depend on

0 commit comments

Comments
 (0)