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

@ -379,7 +379,7 @@ fn (n &mapnode) subkeys(mut keys []string, at int) int {
}
pub fn (m &SortedMap) keys() []string {
mut keys := [''].repeat(m.len)
mut keys := []string{len:m.len}
if isnil(m.root) || m.root.len == 0 {
return keys
}