From 1aac2a9303c5dc84749a2132bf47a726deb56533 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 15 Jan 2025 05:25:55 -0800 Subject: [PATCH] model_physics: remove pointless unsafe usage from the before times --- strafe-client/src/model_physics.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/strafe-client/src/model_physics.rs b/strafe-client/src/model_physics.rs index d9d30f1..fd9be5d 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) } } @@ -364,10 +364,10 @@ impl TryFrom<&model::Mesh> for PhysicsMesh{ edge_ref_faces.push(!is_sorted as usize,submesh_face_id); //index edges & face into vertices { - let vert_ref_guy=unsafe{vert_ref_guys.get_unchecked_mut(submesh_vert0_id.get() as usize)}; + let vert_ref_guy=&mut vert_ref_guys[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)