Skip to content

Commit 8315230

Browse files
committed
resolved comments
1 parent d56f74f commit 8315230

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

include/gl/impl/adjacency_matrix.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ class adjacency_matrix final {
138138
}
139139

140140
[[nodiscard]] bool has_edge(const edge_type& edge) const {
141-
const auto first_id = edge.first();
142-
const auto second_id = edge.second();
143-
141+
const auto [first_id, second_id] = edge.incident_vertices();
144142
if (not (this->_is_valid_vertex_id(first_id) and this->_is_valid_vertex_id(second_id)))
145143
return false;
146144

include/gl/impl/specialized/adjacency_matrix.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,10 @@ struct undirected_adjacency_matrix {
265265
detail::strict_get<impl_type>(self._matrix, &edge) = nullptr;
266266
}
267267
else {
268-
const auto first_id = edge.first();
269-
const auto second_id = edge.second();
270-
271268
detail::strict_get<impl_type>(self._matrix, &edge) = nullptr;
272269
// if the edge was found in the first matrix cell,
273270
// it will also be present in the second matrix cell
274-
self._matrix[second_id][first_id] = nullptr;
271+
self._matrix[edge.second()][edge.first()] = nullptr;
275272
}
276273
--self._n_unique_edges;
277274
}

0 commit comments

Comments
 (0)