builtin: fix a bug in `[]string.join()`

pull/9440/head
Delyan Angelov 2021-03-23 20:14:46 +02:00
parent 8abfe2f5a2
commit 419ee8ae2a
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 1 deletions

View File

@ -1576,7 +1576,7 @@ pub fn (a []string) join(del string) string {
} }
len -= del.len len -= del.len
// Allocate enough memory // Allocate enough memory
mut res := '' mut res := string{}
res.len = len res.len = len
res.str = unsafe { malloc(res.len + 1) } res.str = unsafe { malloc(res.len + 1) }
mut idx := 0 mut idx := 0