Skip to content

Commit 5020a26

Browse files
committed
remove redundant code
1 parent f0997d8 commit 5020a26

19 files changed

+37
-46
lines changed

jscomp/bsb/bsb_build_schemas.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525

26-
let files = "files"
26+
(* let files = "files" *)
2727
let version = "version"
2828
let name = "name"
2929
(* let ocaml_config = "ocaml-config" *)

jscomp/bsb/bsb_file.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let install_if_exists ~destdir input_name =
3838
if Sys.file_exists input_name then
3939
let output_name = (Filename.concat destdir (Filename.basename input_name)) in
4040
match Unix.stat output_name , Unix.stat input_name with
41-
| {st_mtime = output_stamp}, {st_mtime = input_stamp} when input_stamp <= output_stamp
41+
| {st_mtime = output_stamp;_}, {st_mtime = input_stamp;_} when input_stamp <= output_stamp
4242
-> false
4343
| _ -> copy_with_permission input_name output_name; true
4444
| exception _ -> copy_with_permission input_name output_name; true

jscomp/bsb/bsb_global_paths.mli

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ val vendor_bsdep : string
3535

3636
val vendor_bsppx : string
3737

38-
val vendor_bsppx : string
39-
4038
val ocaml_dir : string
4139

4240
val ocaml_lib_dir : string

jscomp/bsb_helper/bsb_helper_arg.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type spec =
1313
| Set_int of int ref
1414

1515
exception Bad of string
16-
exception Help of string
16+
(* exception Help of string *)
1717

1818
type error =
1919
| Unknown of string
@@ -29,14 +29,14 @@ type t = (string * spec * string) list
2929
let rec assoc3 (x : string) (l : t) =
3030
match l with
3131
| [] -> None
32-
| (y1, y2, y3) :: t when y1 = x -> Some y2
32+
| (y1, y2, _y3) :: _t when y1 = x -> Some y2
3333
| _ :: t -> assoc3 x t
3434
;;
3535

3636

3737

3838
let usage_b (buf : Ext_buffer.t) speclist errmsg =
39-
let print_spec buf (key, spec, doc) =
39+
let print_spec buf (key, _spec, doc) =
4040
if doc <> "" then begin
4141
Ext_buffer.add_string buf " ";
4242
Ext_buffer.add_string_char buf key ' ';
@@ -100,7 +100,7 @@ let parse_exn (speclist : t) anonfun errmsg =
100100
| None -> stop_raise (Unknown s)
101101
in
102102
begin try
103-
let rec treat_action = function
103+
let treat_action = function
104104
| Unit f -> f ();
105105
| Set r -> r := true;
106106
| String f when !current + 1 < l ->

jscomp/common/bs_loc.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let merge (l: t) (r : t) =
3535
if is_ghost l then r
3636
else if is_ghost r then l
3737
else match l,r with
38-
| {loc_start ; }, {loc_end; _} (* TODO: improve*)
38+
| {loc_start ; _}, {loc_end; _} (* TODO: improve*)
3939
->
4040
{loc_start ;loc_end; loc_ghost = false}
4141

jscomp/common/js_config.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ let diagnose = ref false
6161
let get_diagnose () = !diagnose
6262
let set_diagnose b = diagnose := b
6363

64-
let (//) = Filename.concat
64+
(* let (//) = Filename.concat *)
6565

6666
(* let get_packages_info () = !packages_info *)
6767

jscomp/ext/ext_buffer.ml

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ let create n =
3131
{buffer = s; position = 0; length = n; initial_buffer = s}
3232

3333
let contents b = Bytes.sub_string b.buffer 0 b.position
34-
let to_bytes b = Bytes.sub b.buffer 0 b.position
34+
(* let to_bytes b = Bytes.sub b.buffer 0 b.position *)
3535

36-
let sub b ofs len =
36+
(* let sub b ofs len =
3737
if ofs < 0 || len < 0 || ofs > b.position - len
3838
then invalid_arg "Ext_buffer.sub"
39-
else Bytes.sub_string b.buffer ofs len
39+
else Bytes.sub_string b.buffer ofs len *)
4040

4141

42-
let blit src srcoff dst dstoff len =
42+
(* let blit src srcoff dst dstoff len =
4343
if len < 0 || srcoff < 0 || srcoff > src.position - len
4444
|| dstoff < 0 || dstoff > (Bytes.length dst) - len
4545
then invalid_arg "Ext_buffer.blit"
4646
else
47-
Bytes.unsafe_blit src.buffer srcoff dst dstoff len
47+
Bytes.unsafe_blit src.buffer srcoff dst dstoff len *)
4848

4949
let length b = b.position
5050
let is_empty b = b.position = 0
5151
let clear b = b.position <- 0
5252

53-
let reset b =
53+
(* let reset b =
5454
b.position <- 0; b.buffer <- b.initial_buffer;
55-
b.length <- Bytes.length b.buffer
55+
b.length <- Bytes.length b.buffer *)
5656

5757
let resize b more =
5858
let len = b.length in

jscomp/ext/ext_color.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ type style
4242
| Dim
4343

4444

45-
let ansi_of_color = function
45+
(* let ansi_of_color = function
4646
| Black -> "0"
4747
| Red -> "1"
4848
| Green -> "2"
4949
| Yellow -> "3"
5050
| Blue -> "4"
5151
| Magenta -> "5"
5252
| Cyan -> "6"
53-
| White -> "7"
53+
| White -> "7" *)
5454

5555
let code_of_style = function
5656
| FG Black -> "30"

jscomp/ext/ext_format.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ let to_out_channel = formatter_of_out_channel
100100
(* let set_needed_space_function _ _ = () *)
101101
let flush = pp_print_flush
102102

103-
let list = pp_print_list
103+
(* let list = pp_print_list *)
104104

105105
let rec pp_print_queue ?(pp_sep = pp_print_cut) pp_v ppf q =
106106
Queue.iter (fun q -> pp_v ppf q ; pp_sep ppf ()) q

jscomp/ext/ext_obj.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ let bt () =
122122
| Some bt ->
123123
(match !acc with
124124
| [] -> acc := [bt]
125-
| hd::tl -> if hd <> bt then acc := bt :: !acc )
125+
| hd::_ -> if hd <> bt then acc := bt :: !acc )
126126

127127
done);
128128
Ext_list.iter !acc (fun bt ->

jscomp/ext/ext_pp.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ let newline t =
7474
if not t.last_new_line then
7575
begin
7676
t.output_char '\n';
77-
for i = 0 to t.indent_level - 1 do
77+
for _ = 0 to t.indent_level - 1 do
7878
t.output_string L.indent_str;
7979
done;
8080
t.last_new_line <- true
8181
end
8282

8383
let force_newline t =
8484
t.output_char '\n';
85-
for i = 0 to t.indent_level - 1 do
85+
for _ = 0 to t.indent_level - 1 do
8686
t.output_string L.indent_str;
8787
done
8888

@@ -170,7 +170,7 @@ let cond_paren_group st b n action =
170170
let brace_group st n action =
171171
group st n (fun _ -> brace st action )
172172

173-
let indent t n =
174-
t.indent_level <- t.indent_level + n
173+
(* let indent t n =
174+
t.indent_level <- t.indent_level + n *)
175175

176176
let flush t () = t.flush ()

jscomp/ext/ext_ref.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let protect2 r1 r2 v1 v2 body =
6666
raise x
6767

6868
let protect_list rvs body =
69-
let olds = Ext_list.map rvs (fun (x,y) -> !x) in
69+
let olds = Ext_list.map rvs (fun (x,_) -> !x) in
7070
let () = List.iter (fun (x,y) -> x:=y) rvs in
7171
try
7272
let res = body () in

jscomp/ext/ext_string.ml

+6-6
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,21 @@ let ends_with_then_chop s beg =
112112
if i >= 0 then Some (String.sub s 0 i)
113113
else None
114114

115-
let check_suffix_case = ends_with
116-
let check_suffix_case_then_chop = ends_with_then_chop
115+
(* let check_suffix_case = ends_with *)
116+
(* let check_suffix_case_then_chop = ends_with_then_chop *)
117117

118-
let check_any_suffix_case s suffixes =
119-
Ext_list.exists suffixes (fun x -> check_suffix_case s x)
118+
(* let check_any_suffix_case s suffixes =
119+
Ext_list.exists suffixes (fun x -> check_suffix_case s x) *)
120120

121-
let check_any_suffix_case_then_chop s suffixes =
121+
(* let check_any_suffix_case_then_chop s suffixes =
122122
let rec aux suffixes =
123123
match suffixes with
124124
| [] -> None
125125
| x::xs ->
126126
let id = ends_with_index s x in
127127
if id >= 0 then Some (String.sub s 0 id)
128128
else aux xs in
129-
aux suffixes
129+
aux suffixes *)
130130

131131

132132

jscomp/ext/ext_sys.ml

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525
(** TODO: not exported yet, wait for Windows Fix*)
26-
let is_directory_no_exn f =
27-
try Sys.is_directory f with _ -> false
26+
(* let is_directory_no_exn f =
27+
try Sys.is_directory f with _ -> false *)
2828

2929

3030
let is_windows_or_cygwin = Sys.win32 || Sys.cygwin
3131

3232

33-
let getenv_opt = Sys.getenv_opt

jscomp/ext/ext_sys.mli

-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,3 @@
2929

3030
val is_windows_or_cygwin : bool
3131

32-
val getenv_opt :
33-
string ->
34-
string option

jscomp/ext/ext_utf8.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ let rec next s ~remaining offset =
6767
if remaining = 0 then offset
6868
else
6969
begin match classify s.[offset+1] with
70-
| Cont cc -> next s ~remaining:(remaining-1) (offset+1)
70+
| Cont _cc -> next s ~remaining:(remaining-1) (offset+1)
7171
| _ -> -1
7272
| exception _ -> -1 (* it can happen when out of bound *)
7373
end
@@ -99,5 +99,5 @@ let decode_utf8_string s =
9999
location, then we do the decode later
100100
*)
101101

102-
let verify s loc =
103-
assert false
102+
(* let verify s loc =
103+
assert false *)

jscomp/ext/set_gen.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let rec cons_enum s e =
2626
| Empty -> e
2727
| Node(l,v,r,_) -> cons_enum l (More(v,r,e))
2828

29-
let rec height = function
29+
let height = function
3030
| Empty -> 0
3131
| Node(_,_,_,h) -> h
3232

@@ -373,8 +373,6 @@ module type S = sig
373373
val min_elt: t -> elt
374374
val max_elt: t -> elt
375375
val choose: t -> elt
376-
val of_sorted_list : elt list -> t
377-
val of_sorted_array : elt array -> t
378376
val partition: t -> (elt -> bool) -> t * t
379377

380378
val mem: t -> elt -> bool

jscomp/ext/vec_gen.ml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ sig
4040
val make : int -> t
4141
val init : int -> (int -> elt) -> t
4242
val is_empty : t -> bool
43-
val of_array : elt array -> t
4443
val of_sub_array : elt array -> int -> int -> t
4544

4645
(** Exposed for some APIs which only take array as input,

jscomp/super_errors/super_main.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(* the entry point. This is used by js_main.ml *)
22
let setup =
3-
lazy (match Ext_sys.getenv_opt "BS_VSCODE" with
3+
lazy (match Sys.getenv_opt "BS_VSCODE" with
44
| Some ("true" | "1") ->
55
()
66
| Some _ | None ->

0 commit comments

Comments
 (0)