refactor: simplify load_entries in command and theme palette

This commit is contained in:
CJ van den Berg 2024-08-19 22:53:38 +02:00
parent 67ffff4caa
commit e83d9ea74d
2 changed files with 3 additions and 10 deletions

View file

@ -17,11 +17,7 @@ pub const Entry = struct {
pub fn load_entries(palette: *Type) !void {
for (command.commands.items) |cmd_| if (cmd_) |p| {
(palette.entries.addOne() catch @panic("oom")).* = .{
.name = p.name,
.id = p.id,
.used_time = 0,
};
(try palette.entries.addOne()).* = .{ .name = p.name, .id = p.id, .used_time = 0 };
};
}