strings, builtin: remove strings.Builder.clear(), fix array.clear() not working in the JS backend (#23992)

This commit is contained in:
XiaoPangxie732 2025-03-22 23:24:59 +08:00 committed by GitHub
parent 20d7d9758b
commit 15c0e6f2bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 12 deletions

View file

@ -22,10 +22,6 @@ pub fn (mut b Builder) write_byte(data u8) {
b << data
}
pub fn (mut b Builder) clear() {
b = []u8{cap: b.cap}
}
pub fn (mut b Builder) write_u8(data u8) {
b << data
}
@ -67,7 +63,7 @@ pub fn (mut b Builder) str() string {
#for (const c of b.val.arr.arr)
#s.str += String.fromCharCode(+c)
b.trim(0)
b.clear()
return s
}