#question about HashMaps
1 messages · Page 1 of 1 (latest)
btw, is the key type an enum? if it is and you're not using any special hashing function (and don't need to preserve insertion order), consider using a std.EnumMap instead of a general-purpose hash map - because the maximal number of keys is statically known and indexes can be computed easily, std.EnumMap does not need an allocator, and is much faster
var vertices_map = std.EnumMap(types.faces, []Vec3).init(.{
.BACK = …,
.LEFT = …,
.RIGHT = …,
})
replace the …s with the values