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

all: add strings.Builder.write_string and use write_string instead of write (#8892)

This commit is contained in:
zakuro
2021-02-22 20:18:11 +09:00
committed by GitHub
parent 36a6bc270c
commit f54c1a5cc2
34 changed files with 402 additions and 397 deletions

View File

@ -37,9 +37,14 @@ pub fn (mut b Builder) write_b(data byte) {
b.len++
}
[deprecated: 'write(string) will be changed to write([]byte)']
pub fn (mut b Builder) write(s string) {
b.write_string(s)
}
// write appends the string `s` to the buffer
[inline]
pub fn (mut b Builder) write(s string) {
pub fn (mut b Builder) write_string(s string) {
if s == '' {
return
}