From 514a893918e223d70caca063e40d7a7ed2e2cead Mon Sep 17 00:00:00 2001 From: LeRoyce Pearson Date: Wed, 16 Jun 2021 00:56:01 -0600 Subject: [PATCH] Update Registry.removeAll to 0.8.0 HashMap API --- zig-ecs/src/ecs/registry.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zig-ecs/src/ecs/registry.zig b/zig-ecs/src/ecs/registry.zig index 22fc0ff..407e293 100644 --- a/zig-ecs/src/ecs/registry.zig +++ b/zig-ecs/src/ecs/registry.zig @@ -343,10 +343,10 @@ pub const Registry = struct { pub fn removeAll(self: *Registry, entity: Entity) void { assert(self.valid(entity)); - var iter = self.components.iterator(); - while (iter.next()) |ptr| { + var iter = self.components.valueIterator(); + while (iter.next()) |value| { // HACK: we dont know the Type here but we need to be able to call methods on the Storage(T) - var store = @intToPtr(*Storage(u1), ptr.value); + var store = @intToPtr(*Storage(u1), value.*); store.removeIfContains(entity); } }