This commit is contained in:
Adrien Bouvais 2025-01-13 20:06:16 +01:00
parent 1031e767bc
commit e818700905

View File

@ -366,7 +366,7 @@ pub fn parse(self: *Parser, buffer: [:0]const u8) ZipponError!void {
maps.append(data_map.cloneWithAllocator(local_allocator) catch return ZipponError.MemoryError) catch return ZipponError.MemoryError; maps.append(data_map.cloneWithAllocator(local_allocator) catch return ZipponError.MemoryError) catch return ZipponError.MemoryError;
if (maps.items.len >= 1_000) { if (maps.items.len >= 1_000) {
self.file_engine.addEntity(struct_name, maps.items, &buff.writer()) catch return ZipponError.CantWriteEntity; try self.file_engine.addEntity(struct_name, maps.items, &buff.writer());
maps.clearRetainingCapacity(); maps.clearRetainingCapacity();
_ = local_arena.reset(.retain_capacity); _ = local_arena.reset(.retain_capacity);
} }
@ -376,7 +376,7 @@ pub fn parse(self: *Parser, buffer: [:0]const u8) ZipponError!void {
break; break;
} }
self.file_engine.addEntity(struct_name, maps.items, &buff.writer()) catch return ZipponError.CantWriteEntity; try self.file_engine.addEntity(struct_name, maps.items, &buff.writer());
buff.writer().writeAll("]") catch return ZipponError.WriteError; buff.writer().writeAll("]") catch return ZipponError.WriteError;
send("{s}", .{buff.items}); send("{s}", .{buff.items});