module: remove error-prone "optimized" function variants for now

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-12-24 17:02:26 -07:00
parent 15c3f772ef
commit 5ed75fb3ee
2 changed files with 1 additions and 28 deletions

View file

@ -87,33 +87,6 @@ pub fn Objects(options: ObjectsOptions, comptime T: type) type {
index: Index,
objs: *Objects(options, T),
/// Same as Objects(T).set but doesn't employ safety checks
pub fn set(s: *@This(), id: ObjectID, value: T) void {
const data = &s.objs.internal.data;
const unpacked: PackedID = @bitCast(id);
data.set(unpacked.index, value);
}
/// Same as Objects(T).get but doesn't employ safety checks
pub fn get(s: *@This(), id: ObjectID) T {
const data = &s.objs.internal.data;
const unpacked: PackedID = @bitCast(id);
return data.get(unpacked.index);
}
/// Same as Objects(T).delete but doesn't employ safety checks
pub fn delete(s: *@This(), id: ObjectID) void {
const dead = &s.objs.internal.dead;
const recycling_bin = &s.objs.internal.recycling_bin;
const unpacked: PackedID = @bitCast(id);
if (recycling_bin.items.len < recycling_bin.capacity) {
recycling_bin.appendAssumeCapacity(unpacked.index);
} else s.objs.internal.thrown_on_the_floor += 1;
dead.set(unpacked.index);
}
pub fn next(s: *Slice) ?ObjectID {
const dead = &s.objs.internal.dead;
const generation = &s.objs.internal.generation;