From 84a9cf17b9c6baa9e11bf7fd94631a4bb83ef3f3 Mon Sep 17 00:00:00 2001 From: Caleb Gardner Date: Thu, 21 May 2026 05:42:00 -0500 Subject: [PATCH] Fixed some issues with stateless Lookup Table --- src/lookup_table.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lookup_table.zig b/src/lookup_table.zig index fc395f0..9169141 100644 --- a/src/lookup_table.zig +++ b/src/lookup_table.zig @@ -5,7 +5,7 @@ const Decompressor = @import("util/decompressor.zig"); const MetadataReader = @import("util/metadata.zig"); const OffsetFile = @import("util/offset_file.zig"); -pub fn lookupValue(comptime T: anytype, alloc: std.mem.Allocator, io: Io, decomp: *Decompressor, file: OffsetFile, table_start: u64, idx: u16) !T { +pub fn lookupValue(comptime T: anytype, alloc: std.mem.Allocator, io: Io, decomp: *const Decompressor, file: OffsetFile, table_start: u64, idx: u32) !T { const T_PER_BLOCK: u16 = 8192 / @sizeOf(T); const block = idx / T_PER_BLOCK; @@ -16,7 +16,7 @@ pub fn lookupValue(comptime T: anytype, alloc: std.mem.Allocator, io: Io, decomp try rdr.interface.readSliceEndian(u64, @ptrCast(&offset), .little); rdr = try file.readerAt(io, offset, &[0]u8{}); - var meta: MetadataReader = .init(alloc, &rdr, decomp); + var meta: MetadataReader = .init(alloc, &rdr.interface, decomp); try meta.interface.discardAll(@sizeOf(T) * block_offset); var out: T = undefined;