mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen,map: fix leaks in keys()
and for x in y
This commit is contained in:
@ -448,7 +448,7 @@ pub fn (mut m map) delete(key string) {
|
||||
// Returns all keys in the map.
|
||||
// TODO: add optimization in case of no deletes
|
||||
pub fn (m &map) keys() []string {
|
||||
mut keys := [''].repeat(m.len)
|
||||
mut keys := []string{ len:m.len }
|
||||
mut j := 0
|
||||
for i := u32(0); i < m.key_values.len; i++ {
|
||||
if m.key_values.keys[i].str == 0 {
|
||||
|
Reference in New Issue
Block a user