points теперь слайс

This commit is contained in:
2026-03-03 20:38:57 +03:00
parent 9a795c22f1
commit 446cd80616
10 changed files with 86 additions and 67 deletions

View File

@@ -44,7 +44,7 @@ pub fn getProperty(self: Object, tag: std.meta.Tag(PropertyData)) ?*const Proper
pub fn setProperty(self: *Object, allocator: std.mem.Allocator, prop: Property) !void {
for (self.properties.items, 0..) |*p, i| {
if (std.meta.activeTag(p.data) == std.meta.activeTag(prop.data)) {
if (p.data == .points) p.data.points.deinit(allocator);
if (p.data == .points) allocator.free(p.data.points);
self.properties.items[i] = prop;
return;
}