Skip to content

Commit 6a590f1

Browse files
authored
builtin: reset .len and .cap to 0 too, in the array.free() method (#25717)
1 parent ee9eefd commit 6a590f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vlib/builtin/array.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ pub fn (a &array) free() {
845845
unsafe {
846846
a.data = nil
847847
a.offset = 0
848+
a.len = 0
849+
a.cap = 0
848850
}
849851
}
850852

0 commit comments

Comments
 (0)