Skip to content

Commit 8e0ec97

Browse files
Pass rr edge indices by value in edge sorting functors
1 parent a9472ca commit 8e0ec97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libs/librrgraph/src/base/rr_graph_storage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class edge_compare_dest_node {
143143
public:
144144
edge_compare_dest_node(const t_rr_graph_storage& rr_graph_storage) : rr_graph_storage_(rr_graph_storage) {}
145145

146-
bool operator()(const size_t& lhs_idx, const size_t& rhs_idx) {
146+
bool operator()(size_t lhs_idx, size_t rhs_idx) const {
147147
RREdgeId lhs = RREdgeId(lhs_idx);
148148
RREdgeId rhs = RREdgeId(rhs_idx);
149149

@@ -269,7 +269,7 @@ class edge_compare_src_node_and_configurable_first {
269269
: rr_switch_inf_(rr_switch_inf),
270270
rr_graph_storage_(rr_graph_storage) {}
271271

272-
bool operator()(const size_t& lhs_idx, const size_t& rhs_idx) {
272+
bool operator()(size_t lhs_idx, size_t rhs_idx) const {
273273
RREdgeId lhs = RREdgeId(lhs_idx);
274274
RREdgeId rhs = RREdgeId(rhs_idx);
275275

libs/librrgraph/src/base/rr_graph_storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ class t_rr_graph_storage {
818818
* @brief Sorts edges according to comparison_function. This is an expensive method that builds the edge array from scratch
819819
* and invalidates all the RREdgeIds. This is not an inplace sort, and it is very expensive.
820820
* You should not be calling this method more than once or twice in the entire program, definitely do not use it in a hot loop.
821-
* @tparam t_comp_func callable object with two const size_t& arguments. See 'edge_compare_dest_node' for example.
821+
* @tparam t_comp_func callable object with two size_t arguments. See 'edge_compare_dest_node' for example.
822822
* @param comparison_function Comparison function to order edges with.
823823
*/
824824
template <typename t_comp_func>

0 commit comments

Comments
 (0)