@@ -219,9 +219,9 @@ void entity_graph::visit_edges(index_type node_index0, index_type node_index1, F
219219 } else {
220220 func (edge_index);
221221 }
222- auto ¤t_edge = m_edges[edge_index];
223- EDYN_ASSERT (current_edge .next != edge_index);
224- edge_index = current_edge .next ;
222+ auto &edge = m_edges[edge_index];
223+ EDYN_ASSERT (edge .next != edge_index);
224+ edge_index = edge .next ;
225225 }
226226 break ;
227227 }
@@ -241,9 +241,9 @@ void entity_graph::visit_edges(index_type node_index, Func func) const {
241241 auto edge_index = adj.edge_index ;
242242
243243 while (edge_index != null_index) {
244- auto ¤t_edge = m_edges[edge_index];
245- EDYN_ASSERT (current_edge .next != edge_index);
246- auto next_edge_index = current_edge .next ;
244+ auto &edge = m_edges[edge_index];
245+ EDYN_ASSERT (edge .next != edge_index);
246+ auto next_edge_index = edge .next ;
247247 if constexpr (std::is_invocable_r_v<bool , Func, index_type>) {
248248 if (!func (edge_index)) {
249249 return ;
@@ -296,33 +296,33 @@ void entity_graph::reach(It first, It last, VisitNodeFunc visit_node_func,
296296
297297 visited[node_index] = true ;
298298
299- const auto ¤t_node = m_nodes[node_index];
300- EDYN_ASSERT (current_node .entity != entt::null);
301- visit_node_func (current_node .entity );
299+ const auto &node = m_nodes[node_index];
300+ EDYN_ASSERT (node .entity != entt::null);
301+ visit_node_func (node .entity );
302302
303303 // Stop here for non-connecting nodes. Do not visit edges.
304- if (current_node .non_connecting ) {
304+ if (node .non_connecting ) {
305305 non_connecting_indices.push_back (node_index);
306306 continue ;
307307 }
308308
309309 // Visit all edges in all adjacencies.
310- auto adj_index = current_node .adjacency_index ;
310+ auto adj_index = node .adjacency_index ;
311311
312312 while (adj_index != null_index) {
313313 auto &adj = m_adjacencies[adj_index];
314314 auto edge_index = adj.edge_index ;
315315
316316 while (edge_index != null_index) {
317- auto ¤t_edge = m_edges[edge_index];
317+ auto &edge = m_edges[edge_index];
318318
319319 if (!visited_edges[edge_index]) {
320- EDYN_ASSERT (current_edge .entity != entt::null);
321- visit_edge_func (current_edge .entity );
320+ EDYN_ASSERT (edge .entity != entt::null);
321+ visit_edge_func (edge .entity );
322322 visited_edges[edge_index] = true ;
323323 }
324324
325- edge_index = current_edge .next ;
325+ edge_index = edge .next ;
326326 }
327327
328328 // Perhaps visit neighboring node and its edges next.
@@ -375,18 +375,18 @@ void entity_graph::traverse(index_type start_node_index,
375375 to_visit.pop_back ();
376376
377377 visited[node_index] = true ;
378- const auto ¤t_node = m_nodes[node_index];
379- EDYN_ASSERT (current_node .entity != entt::null);
378+ const auto &node = m_nodes[node_index];
379+ EDYN_ASSERT (node .entity != entt::null);
380380
381381 visit_node_func (node_index);
382382
383383 // Do not visit neighbors of non-connecting nodes.
384- if (current_node .non_connecting ) {
384+ if (node .non_connecting ) {
385385 continue ;
386386 }
387387
388388 // Add neighbors to be visited.
389- auto adj_index = current_node .adjacency_index ;
389+ auto adj_index = node .adjacency_index ;
390390
391391 while (adj_index != null_index) {
392392 auto &adj = m_adjacencies[adj_index];
@@ -395,15 +395,15 @@ void entity_graph::traverse(index_type start_node_index,
395395 auto edge_index = adj.edge_index ;
396396
397397 while (edge_index != null_index) {
398- auto ¤t_edge = m_edges[edge_index];
398+ auto &edge = m_edges[edge_index];
399399
400400 if (!visited_edges[edge_index]) {
401- EDYN_ASSERT (current_edge .entity != entt::null);
401+ EDYN_ASSERT (edge .entity != entt::null);
402402 visit_edge_func (edge_index);
403403 visited_edges[edge_index] = true ;
404404 }
405405
406- edge_index = current_edge .next ;
406+ edge_index = edge .next ;
407407 }
408408 }
409409
0 commit comments