remove hack

This commit is contained in:
silverweed 2025-01-22 15:28:47 +01:00
parent 89b37412db
commit a1caf3951c

View file

@ -339,7 +339,7 @@ b8 walk_tkeys(Arena *arena, const u8 *data, u64 data_len, u32 flags, TFile_Data
// collect free slots
TFile_Free_Slot fs;
u64 free_slot_size = sizeof(u16) + (is_big_file ? sizeof(fs.rng.rng_long) : sizeof(fs.rng.rng_short));
u64 free_slots_start = tkeys_data.sections[Sec_TFile_FreeList].range.start + 65; // XXX: the keylen should be subtracted above!
u64 free_slots_start = tkeys_data.sections[Sec_TFile_FreeList].range.start;
u64 free_slots_end = tkeys_data.sections[Sec_TFile_FreeList].range.end();
u64 n_free_slots = (free_slots_end - free_slots_start) / free_slot_size;
if (n_free_slots) {
@ -368,6 +368,7 @@ b8 walk_tkeys(Arena *arena, const u8 *data, u64 data_len, u32 flags, TFile_Data
free_slot->len = end - start + 1; // +1 because `end` is inclusive
++i;
} else {
assert(n_free_slots > 0);
--n_free_slots;
}
}