Skip to content

Commit

Permalink
de: Avoid nested arenas in optional visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
ibokuri committed Nov 21, 2023
1 parent 00c5b4f commit 14c64a1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/de/impls/visitor/optional.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const std = @import("std");

const getty_deserialize = @import("../../deserialize.zig").deserialize;
const deserializeLeaky = @import("../../deserialize.zig").deserializeLeaky;
const VisitorInterface = @import("../../interfaces/visitor.zig").Visitor;

pub fn Visitor(comptime Optional: type) type {
Expand All @@ -23,8 +23,7 @@ pub fn Visitor(comptime Optional: type) type {
}

fn visitSome(_: Self, ally: std.mem.Allocator, deserializer: anytype) @TypeOf(deserializer).Err!Value {
const result = try getty_deserialize(ally, std.meta.Child(Value), deserializer);
return result.value;
return try deserializeLeaky(ally, std.meta.Child(Value), deserializer);
}
};
}

0 comments on commit 14c64a1

Please sign in to comment.