Update types.odin

Use `context.allocator := allocator` idiom.
This commit is contained in:
Jeroen van Rijn
2023-03-25 07:33:34 +01:00
parent 95497626e3
commit 4c13dee18f
+6 -6
View File
@@ -88,20 +88,20 @@ Error :: enum {
destroy_value :: proc(value: Value, allocator := context.allocator) {
context.allocator := allocator
#partial switch v in value {
case Object:
for key, elem in v {
delete(key, allocator)
destroy_value(elem, allocator)
delete(key)
destroy_value(elem)
}
delete(v)
case Array:
for elem in v {
destroy_value(elem, allocator)
destroy_value(elem)
}
delete(v)
case String:
delete(v, allocator)
delete(v)
}
}
}