mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: change [0;n]
to [0].repeat(n)
This commit is contained in:

committed by
Alexander Medvednikov

parent
602e472b8a
commit
f077fbd32d
@ -247,14 +247,14 @@ fn escape(s string, mode EncodingMode) string {
|
||||
return s
|
||||
}
|
||||
|
||||
mut buf := [byte(0); 64]
|
||||
mut buf := [byte(0)].repeat(64)
|
||||
mut t := []byte
|
||||
|
||||
required := s.len + 2*hex_count
|
||||
if required <= buf.len {
|
||||
t = buf.left(required)
|
||||
} else {
|
||||
t = [byte(0); required]
|
||||
t = [byte(0)].repeat(required)
|
||||
}
|
||||
|
||||
if hex_count == 0 {
|
||||
|
Reference in New Issue
Block a user