mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
builtin: fix m.len to 0, after calling map.clear() (#16720)
This commit is contained in:
parent
f9043c84a7
commit
e01dac885c
2 changed files with 43 additions and 0 deletions
|
@ -299,6 +299,7 @@ pub fn (mut m map) move() map {
|
|||
// Example: a.clear() // `a.len` and `a.key_values.len` is now 0
|
||||
pub fn (mut m map) clear() {
|
||||
m.len = 0
|
||||
m.even_index = 0
|
||||
m.key_values.len = 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue