mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
strings: use memdup_noscan in Builder.str()
This commit is contained in:
parent
a987440e2f
commit
2c3e44eb20
@ -150,7 +150,7 @@ pub fn (b &Builder) after(n int) string {
|
||||
// .str() call.
|
||||
pub fn (mut b Builder) str() string {
|
||||
b << byte(0)
|
||||
bcopy := unsafe { &byte(memdup(b.data, b.len)) }
|
||||
bcopy := unsafe { &byte(memdup_noscan(b.data, b.len)) }
|
||||
s := unsafe { bcopy.vstring_with_len(b.len - 1) }
|
||||
b.trim(0)
|
||||
return s
|
||||
|
Loading…
Reference in New Issue
Block a user