From 9a89640b7938ddc674c4948b5760579ecd1bf726 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 15 Jan 2025 05:25:55 -0800 Subject: [PATCH] remove pointless unsafe usage from the before times --- strafe-client/src/model_physics.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strafe-client/src/model_physics.rs b/strafe-client/src/model_physics.rs index d9d30f1..bdcdcb9 100644 --- a/strafe-client/src/model_physics.rs +++ b/strafe-client/src/model_physics.rs @@ -287,7 +287,7 @@ impl EdgePool{ self.edge_id_from_guy.insert(edge_ref_verts,edge_id); edge_id }; - (&mut unsafe{self.edge_guys.get_unchecked_mut(edge_id.get() as usize)}.1,edge_id) + (&mut self.edge_guys[edge_id.get() as usize].1,edge_id) } } @@ -367,7 +367,7 @@ impl TryFrom<&model::Mesh> for PhysicsMesh{ let vert_ref_guy=unsafe{vert_ref_guys.get_unchecked_mut(submesh_vert0_id.get() as usize)}; vert_ref_guy.edges.insert(edge_id.as_directed(is_sorted)); vert_ref_guy.faces.insert(submesh_face_id); - unsafe{vert_ref_guys.get_unchecked_mut(submesh_vert1_id.get() as usize)}.edges.insert(edge_id.as_directed(!is_sorted)); + vert_ref_guys[submesh_vert1_id.get() as usize].edges.insert(edge_id.as_directed(!is_sorted)); } //return directed_edge_id edge_id.as_directed(is_sorted)