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

v.util: make util.smart_quote use its output string builder directly

This commit is contained in:
Delyan Angelov
2021-06-20 20:55:12 +03:00
parent 81fe702b77
commit 45c6b6493b
2 changed files with 73 additions and 47 deletions

View File

@ -45,7 +45,7 @@ pub fn (b &Builder) byte_at(n int) byte {
// write appends the string `s` to the buffer
[inline]
pub fn (mut b Builder) write_string(s string) {
if s == '' {
if s.len == 0 {
return
}
unsafe { b.push_many(s.str, s.len) }