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

add builtin import pass + use builder in map

This commit is contained in:
Joe Conigliaro
2019-08-05 13:54:16 +10:00
committed by Alexander Medvednikov
parent 5ed338dc2e
commit 2fab73983b
2 changed files with 11 additions and 9 deletions

View File

@@ -249,15 +249,11 @@ pub fn (m map_string) str() string {
return '{}'
}
// TODO use bytes buffer
//mut sb := strings.new_builder(50)
//sb.writeln('{')
mut s := '{\n'
mut sb := strings.new_builder(50)
sb.writeln('{')
for key, val in m {
//sb.writeln(' "$entry.key" => "$val"')
s += ' "$key" => "$val"\n'
sb.writeln(' "$key" => "$val"')
}
s += '}\n'
//sb.writeln('}')
//return sb.str()
return s
sb.writeln('}')
return sb.str()
}