Skip to content

Commit

Permalink
linked list free method
Browse files Browse the repository at this point in the history
  • Loading branch information
enghitalo committed Oct 19, 2024
1 parent 9937303 commit 7655490
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vlib/x/json2/decoder2/decode.v
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ fn (list LinkedList) str() string {
return result
}

@[unsafe]
fn (list &LinkedList) free() {
mut current := list.head
for current != unsafe { nil } {
mut next := current.next
unsafe { free(current) }
current = next
}
}

// ValueKind represents the kind of a JSON value.
pub enum ValueKind {
unknown
Expand Down

0 comments on commit 7655490

Please sign in to comment.