builtin: x.vstring() instead of string(x) (#6102)

This commit is contained in:
Delyan Angelov 2020-08-10 19:05:26 +03:00 committed by GitHub
parent eba413853f
commit 36eae1c175
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 143 additions and 72 deletions

View file

@ -4,9 +4,8 @@ pub fn repeat(c byte, n int) string {
if n <= 0 {
return ''
}
mut arr := [c].repeat(n + 1)
arr[n] = `\0`
return string(arr,n)
arr := [c].repeat(n)
return arr.bytestr()
}
pub fn repeat_string(s string, n int) string {