diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-08-09 14:19:42 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-08-09 14:24:25 -0700 |
| commit | aed6a3a343fc9621c74a10fceee530740ec8b183 (patch) | |
| tree | 8c642b92ba758ca8e30df573c22128cf82f5e3fe /src/datastruct/split_tree.zig | |
| parent | ec293c1fd0eeebe7ce72e62c088199937f375877 (diff) | |
apprt/gtk-ng: clean up some changed handlers
Diffstat (limited to 'src/datastruct/split_tree.zig')
| -rw-r--r-- | src/datastruct/split_tree.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/datastruct/split_tree.zig b/src/datastruct/split_tree.zig index 48b887707..14ef6370e 100644 --- a/src/datastruct/split_tree.zig +++ b/src/datastruct/split_tree.zig @@ -826,8 +826,10 @@ pub fn SplitTree(comptime V: type) type { .copy = &struct { fn copy(self: *Self) callconv(.c) *Self { const ptr = @import("glib").ext.create(Self); - const alloc = self.arena.child_allocator; - ptr.* = self.clone(alloc) catch @panic("oom"); + ptr.* = if (self.nodes.len == 0) + .empty + else + self.clone(self.arena.child_allocator) catch @panic("oom"); return ptr; } }.copy, |
