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

vlib,cgen: cleanup array inits using `.repeat() instead of new init syntax

This commit is contained in:
Emily Hudson
2020-06-27 20:46:04 +01:00
committed by GitHub
parent 2669610be9
commit c84bafbdae
31 changed files with 52 additions and 53 deletions

View File

@ -38,7 +38,7 @@ pub fn int_u64(max u64) ?u64 {
fn bytes_to_u64(b []byte) []u64 {
ws := 64/8
mut z := [u64(0)].repeat((b.len + ws - 1) / ws)
mut z := []u64{len:((b.len + ws - 1) / ws)}
mut i := b.len
for k := 0; i >= ws; k++ {
z[k] = binary.big_endian_u64(b[i-ws..i])