From c9eed0b89bbb23c3cde3d139125533582d45ab4d Mon Sep 17 00:00:00 2001 From: yuyi Date: Sun, 29 Mar 2020 16:09:27 +0800 Subject: [PATCH] cgen: optimize a replace call --- vlib/v/gen/cgen.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index bc01fc35a1..89cedc1501 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -139,7 +139,7 @@ pub fn (g mut Gen) write_typeof_functions() { pub fn (g mut Gen) typ(t table.Type) string { nr_muls := table.type_nr_muls(t) sym := g.table.get_type_symbol(t) - mut styp := sym.name.replace_each(['.', '__']) + mut styp := sym.name.replace('.', '__') if nr_muls > 0 { styp += strings.repeat(`*`, nr_muls) } @@ -162,7 +162,7 @@ pub fn (g mut Gen) typ(t table.Type) string { /* pub fn (g &Gen) styp(t string) string { - return t.replace_each(['.', '__']) + return t.replace('.', '__') } */