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

map: make .keys() pure

This commit is contained in:
Alexander Medvednikov 2019-09-25 05:56:10 +03:00 committed by GitHub
parent 55d09d23b4
commit ab52b453cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ fn preorder_keys(node &mapnode, keys mut []string, key_i int) int {
return i return i
} }
pub fn (m mut map) keys() []string { pub fn (m &map) keys() []string {
mut keys := [''].repeat(m.size) mut keys := [''].repeat(m.size)
if isnil(m.root) { if isnil(m.root) {
return keys return keys