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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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])