From 73106b5f5e2cc36b0db36c66c8962e7efeaf06b2 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 27 Apr 2020 13:18:20 +0300 Subject: [PATCH] profile: measure defer{} statements too --- vlib/v/gen/fn.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/v/gen/fn.v b/vlib/v/gen/fn.v index 45833b31d7..7ab6d5bdff 100644 --- a/vlib/v/gen/fn.v +++ b/vlib/v/gen/fn.v @@ -130,15 +130,15 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl) { } fn (mut g Gen) write_defer_stmts_when_needed() { + if g.defer_stmts.len > 0 { + g.write_defer_stmts() + } if g.defer_profile_code.len > 0 { g.writeln('') g.writeln('\t// defer_profile_code') g.writeln(g.defer_profile_code) g.writeln('') } - if g.defer_stmts.len > 0 { - g.write_defer_stmts() - } } fn (mut g Gen) fn_args(args []table.Arg, is_variadic bool) {