Skip to content

Commit aa91fd4

Browse files
committed
tweak
1 parent 06983e7 commit aa91fd4

File tree

4 files changed

+24
-30
lines changed

4 files changed

+24
-30
lines changed

jscomp/bsb_helper/bsb_db_decode.ml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,11 @@ let find_opt
131131
in
132132
Some {case ; dir_name = String.sub whole dir_name_start (dir_name_finish - dir_name_start)}
133133

134-
135-
134+
let find db dependent_module is_not_lib_dir =
135+
let opt = find_opt db 0 dependent_module in
136+
match opt with
137+
| Some _ -> opt
138+
| None ->
139+
if is_not_lib_dir then
140+
find_opt db 1 dependent_module
141+
else None

jscomp/bsb_helper/bsb_db_decode.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ type module_info = {
5252
dir_name : string
5353
}
5454

55-
val find_opt :
55+
val find:
5656
t -> (* contains global info *)
57-
int -> (* more likely to be zero *)
5857
string -> (* module name *)
58+
bool -> (* more likely to be zero *)
5959
module_info option

jscomp/bsb_helper/bsb_helper_depfile_gen.ml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,6 @@ let oc_cmi buf namespace source =
119119
When ns is turned on, `B` is interprted as `Ns-B` which is a cyclic dependency,
120120
it can be errored out earlier
121121
*)
122-
let find_module db dependent_module is_not_lib_dir
123-
: Bsb_db_decode.module_info option =
124-
let opt = Bsb_db_decode.find_opt db 0 dependent_module in
125-
match opt with
126-
| Some _ -> opt
127-
| None ->
128-
if is_not_lib_dir then
129-
Bsb_db_decode.find_opt db 1 dependent_module
130-
else None
131122
let oc_impl
132123
(mlast : string)
133124
(index : Bsb_dir_index.t)
@@ -164,7 +155,7 @@ let oc_impl
164155
end
165156
);
166157
(match
167-
find_module db dependent_module is_not_lib_dir
158+
Bsb_db_decode.find db dependent_module is_not_lib_dir
168159
with
169160
| None -> ()
170161
| Some ({dir_name; case }) ->
@@ -226,7 +217,7 @@ let oc_intf
226217
exit 2
227218
end
228219
);
229-
(match find_module db dependent_module is_not_lib_dir
220+
(match Bsb_db_decode.find db dependent_module is_not_lib_dir
230221
with
231222
| None -> ()
232223
| Some {dir_name; case} ->

lib/4.06.1/bsb_helper.ml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,10 +3413,10 @@ type module_info = {
34133413
dir_name : string
34143414
}
34153415

3416-
val find_opt :
3416+
val find:
34173417
t -> (* contains global info *)
3418-
int -> (* more likely to be zero *)
34193418
string -> (* module name *)
3419+
bool -> (* more likely to be zero *)
34203420
module_info option
34213421
end = struct
34223422
#1 "bsb_db_decode.ml"
@@ -3553,8 +3553,14 @@ let find_opt
35533553
in
35543554
Some {case ; dir_name = String.sub whole dir_name_start (dir_name_finish - dir_name_start)}
35553555

3556-
3557-
3556+
let find db dependent_module is_not_lib_dir =
3557+
let opt = find_opt db 0 dependent_module in
3558+
match opt with
3559+
| Some _ -> opt
3560+
| None ->
3561+
if is_not_lib_dir then
3562+
find_opt db 1 dependent_module
3563+
else None
35583564
end
35593565
module Ext_filename : sig
35603566
#1 "ext_filename.mli"
@@ -4050,15 +4056,6 @@ let oc_cmi buf namespace source =
40504056
When ns is turned on, `B` is interprted as `Ns-B` which is a cyclic dependency,
40514057
it can be errored out earlier
40524058
*)
4053-
let find_module db dependent_module is_not_lib_dir
4054-
: Bsb_db_decode.module_info option =
4055-
let opt = Bsb_db_decode.find_opt db 0 dependent_module in
4056-
match opt with
4057-
| Some _ -> opt
4058-
| None ->
4059-
if is_not_lib_dir then
4060-
Bsb_db_decode.find_opt db 1 dependent_module
4061-
else None
40624059
let oc_impl
40634060
(mlast : string)
40644061
(index : Bsb_dir_index.t)
@@ -4095,7 +4092,7 @@ let oc_impl
40954092
end
40964093
);
40974094
(match
4098-
find_module db dependent_module is_not_lib_dir
4095+
Bsb_db_decode.find db dependent_module is_not_lib_dir
40994096
with
41004097
| None -> ()
41014098
| Some ({dir_name; case }) ->
@@ -4157,7 +4154,7 @@ let oc_intf
41574154
exit 2
41584155
end
41594156
);
4160-
(match find_module db dependent_module is_not_lib_dir
4157+
(match Bsb_db_decode.find db dependent_module is_not_lib_dir
41614158
with
41624159
| None -> ()
41634160
| Some {dir_name; case} ->

0 commit comments

Comments
 (0)