feat: refactor

This commit is contained in:
2025-06-04 17:32:01 +02:00
parent 9c4543eb4a
commit 1fc509f897

View File

@@ -261,14 +261,14 @@ const Model = struct {
}
fn createItems(
ctx: vxfw.DrawContext,
items1: *locked(?std.ArrayList(Arc(*models.Item))),
locked_items: *locked(?std.ArrayList(Arc(*models.Item))),
current_full_name: ?models.FullName,
) !?[]vxfw.Widget {
const text_items = blk2: {
items1.mutex.lock();
defer items1.mutex.unlock();
const text_items = blk: {
locked_items.mutex.lock();
defer locked_items.mutex.unlock();
break :blk2 if (items1.data) |items| blk: {
const items = locked_items.data orelse return null;
const children = try ctx.arena.create(std.ArrayList(*vxfw.Text));
children.* = std.ArrayList(*vxfw.Text).init(ctx.arena);
@@ -320,9 +320,6 @@ const Model = struct {
try children.append(text_element);
}
break :blk children;
} else {
return null;
};
};
const widgets = try ctx.arena.alloc(vxfw.Widget, text_items.items.len);