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

array: remove temporary repeat2()

This commit is contained in:
Alexander Medvednikov
2019-09-19 05:22:24 +03:00
parent cb31eeec55
commit a94c1556ce
10 changed files with 11 additions and 26 deletions

View File

@ -380,7 +380,7 @@ pub fn (s string) index(p string) int {
if p.len > s.len {
return -1
}
mut prefix := [0].repeat2(p.len)
mut prefix := [0].repeat(p.len)
mut j := 0
for i := 1; i < p.len; i++ {
for p[j] != p[i] && j > 0 {
@ -898,7 +898,7 @@ pub fn (s string) bytes() []byte {
if s.len == 0 {
return []byte
}
mut buf := [byte(0)].repeat2(s.len)
mut buf := [byte(0)].repeat(s.len)
C.memcpy(buf.data, s.str, s.len)
return buf
}