1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: optimize a replace call

This commit is contained in:
yuyi 2020-03-29 16:09:27 +08:00 committed by GitHub
parent a333ac1888
commit c9eed0b89b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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('.', '__')
}
*/