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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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 ->

0 commit comments

Comments
 (0)