mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2024-08-29 22:33:41 +02:00
Tail recursion
This commit is contained in:
parent
9fede1e06c
commit
21a3b36f79
@ -122,10 +122,15 @@ let update_raw_data ?(locked=true) () =
|
|||||||
|
|
||||||
let result =
|
let result =
|
||||||
let rec aux ic accu =
|
let rec aux ic accu =
|
||||||
try
|
let l =
|
||||||
aux ic ( (input_line ic)::accu )
|
try
|
||||||
with
|
Some (input_line ic)
|
||||||
| End_of_file -> List.rev accu
|
with
|
||||||
|
| End_of_file -> None
|
||||||
|
in
|
||||||
|
match l with
|
||||||
|
| None -> List.rev accu
|
||||||
|
| Some l -> (aux [@tailcall]) ic (l::accu)
|
||||||
in
|
in
|
||||||
List.concat_map (fun filename ->
|
List.concat_map (fun filename ->
|
||||||
let ic = open_in filename in
|
let ic = open_in filename in
|
||||||
|
Loading…
Reference in New Issue
Block a user