From f00ab076d16d06bf5706d1fc82055bafdc812ce4 Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 13 Feb 2020 01:19:45 +0300 Subject: [PATCH] vfmt: simplify reading source lines --- cmd/tools/vfmt.v | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/tools/vfmt.v b/cmd/tools/vfmt.v index 3b18103f6a..afd83c09a6 100644 --- a/cmd/tools/vfmt.v +++ b/cmd/tools/vfmt.v @@ -337,11 +337,10 @@ fn file_to_mod_name_and_is_module_file(file string) (string,bool) { } fn read_source_lines(file string) ?[]string { - raw_fcontent := os.read_file(file) or { + source_lines := os.read_lines(file) or { return error('can not read $file') } - fcontent := raw_fcontent.replace('\r\n', '\n') - return fcontent.split('\n') + return source_lines } fn get_compile_name_of_potential_v_project(file string) string {