mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
add keys fn.
This commit is contained in:
parent
95201ffcd1
commit
35b15b9481
@ -108,6 +108,15 @@ pub fn (m mut map) sort() {
|
||||
m.is_sorted = true
|
||||
}
|
||||
|
||||
fn (m map) keys() []string {
|
||||
mut keys := []string{}
|
||||
for i := 0; i < m.entries.len; i++ {
|
||||
entry := m.entries[i]
|
||||
keys << entry.key
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
fn (m map) get(key string, out voidptr) bool {
|
||||
if m.is_sorted {
|
||||
// println('\n\nget "$key" sorted')
|
||||
|
Loading…
Reference in New Issue
Block a user