Skip to content

Commit

Permalink
Shorten read_lines function
Browse files Browse the repository at this point in the history
  • Loading branch information
thelema committed Jun 10, 2012
1 parent 5b7ddbe commit 98e5f9f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions odb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ let chomp s = let l = String.length s in if l <> 0 && s.[l-1] = '\r' then String
let print_list l = List.iter (printf "%s ") l; print_newline ()

let read_lines fn =
let ic = open_in fn in
let lst = ref [] in
try while true do
let line = input_line ic in
lst := line :: !lst
done; assert false
let ic = open_in fn and lst = ref [] in
try while true do lst := input_line ic :: !lst done; assert false
with End_of_file -> close_in ic; List.rev !lst

(* Configurable parameters, some by command line *)
Expand Down

0 comments on commit 98e5f9f

Please sign in to comment.