We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f193a8f commit 2d87e7eCopy full SHA for 2d87e7e
jscomp/super_errors/super_location.ml
@@ -4,20 +4,9 @@ let fprintf = Format.fprintf
4
5
6
7
-let file_lines filePath =
8
- let chan = open_in_bin filePath in
9
- let lines = ref [] in
10
- try
11
- while true do
12
- lines := (input_line chan) :: !lines
13
- done;
14
- (* leave this here to make things type. The loop will definitly raise *)
15
- [||]
16
- with
17
- | End_of_file -> begin
18
- close_in chan;
19
- List.rev (!lines) |> Array.of_list
20
- end
+let file_lines filePath =
+ Ext_array.reverse_of_list
+ (Ext_io.rev_lines_of_file filePath)
21
22
let setup_colors () =
23
Misc.Color.setup !Clflags.color
0 commit comments