table: minor optimization of types.v (#7419)

pull/7424/head
yuyi 2020-12-20 11:54:49 +08:00 committed by GitHub
parent af9766a7d6
commit 829334890b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -431,7 +431,11 @@ pub enum Kind {
}
pub fn (t &TypeSymbol) str() string {
return t.name.replace('array_', '[]')
if t.kind in [.array, .array_fixed] {
return t.name.replace('array_', '[]')
} else {
return t.name
}
}
[inline]