From 149151b1e89e98a265740e673fcb6e77b977b0ad Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 17 Mar 2021 03:41:52 +0300 Subject: [PATCH] cgen: minor vfmt --- vlib/v/gen/c/cgen.v | 6 ++---- vlib/v/tests/valgrind/valgrind_test.v | 14 +++++++------- vlib/vweb/vweb.v | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 4c37bb9fab..76ad9e928f 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -4645,11 +4645,9 @@ fn (mut g Gen) const_decl_init_later(mod string, name string, val string, typ ta sym := g.table.get_type_symbol(typ) if styp.starts_with('Array_') { g.cleanups[mod].writeln('\tarray_free(&$cname);') - } - else if styp == 'string' { + } else if styp == 'string' { g.cleanups[mod].writeln('\tstring_free(&$cname);') - } - else if sym.kind == .map { + } else if sym.kind == .map { g.cleanups[mod].writeln('\tmap_free(&$cname);') } } diff --git a/vlib/v/tests/valgrind/valgrind_test.v b/vlib/v/tests/valgrind/valgrind_test.v index 8a71556d2d..7529568868 100644 --- a/vlib/v/tests/valgrind/valgrind_test.v +++ b/vlib/v/tests/valgrind/valgrind_test.v @@ -17,15 +17,15 @@ const turn_off_vcolors = os.setenv('VCOLORS', 'never', true) // Use: `./v -d noskipcompile -d noskip vlib/v/tests/valgrind/valgrind_test.v` to ignore both // const skip_compile_files = [ - 'vlib/v/tests/valgrind/option_reassigned.v', - ] + 'vlib/v/tests/valgrind/option_reassigned.v', +] const skip_valgrind_files = [ - 'vlib/v/tests/valgrind/struct_field.v', - 'vlib/v/tests/valgrind/fn_returning_string_param.v', - 'vlib/v/tests/valgrind/fn_with_return_should_free_local_vars.v', - 'vlib/v/tests/valgrind/option_simple.v', - ] + 'vlib/v/tests/valgrind/struct_field.v', + 'vlib/v/tests/valgrind/fn_returning_string_param.v', + 'vlib/v/tests/valgrind/fn_with_return_should_free_local_vars.v', + 'vlib/v/tests/valgrind/option_simple.v', +] fn vprintln(s string) { $if verbose ? { diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index 86e5cd8576..257cf50ea2 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -298,7 +298,6 @@ pub fn run_app(mut app T, port int) { } } - [manualfree] fn handle_conn(mut conn net.TcpConn, mut app T) { conn.set_read_timeout(30 * time.second)