Skip to content

Commit

Permalink
fix: backport sort_by->sort_unstable_by for neighbor pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
kantai committed Sep 19, 2024
1 parent c3781c7 commit df8b0c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stackslib/src/net/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ impl PeerNetwork {
match org_neighbors.get_mut(&org) {
None => {}
Some(ref mut neighbor_infos) => {
neighbor_infos.sort_by(|&(ref _nk1, ref stats1), &(ref _nk2, ref stats2)| {
PeerNetwork::compare_neighbor_uptime_health(stats1, stats2)
});
neighbor_infos.sort_unstable_by(
|&(ref _nk1, ref stats1), &(ref _nk2, ref stats2)| {
PeerNetwork::compare_neighbor_uptime_health(stats1, stats2)
},
);
}
}
}
Expand Down

0 comments on commit df8b0c2

Please sign in to comment.