Skip to content

Commit 0a042a8

Browse files
committed
f make comparison a bit more readable
1 parent c80a8a3 commit 0a042a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/routing/router.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ struct RouteGraphNode {
151151

152152
impl cmp::Ord for RouteGraphNode {
153153
fn cmp(&self, other: &RouteGraphNode) -> cmp::Ordering {
154-
cmp::max(other.lowest_fee_to_peer_through_node, other.path_htlc_minimum_msat)
155-
.cmp(&cmp::max(self.lowest_fee_to_peer_through_node, self.path_htlc_minimum_msat))
156-
.then_with(|| other.pubkey.serialize().cmp(&self.pubkey.serialize()))
154+
let other_score = cmp::max(other.lowest_fee_to_peer_through_node, other.path_htlc_minimum_msat);
155+
let self_score = cmp::max(self.lowest_fee_to_peer_through_node, self.path_htlc_minimum_msat);
156+
other_score.cmp(&self_score).then_with(|| other.pubkey.serialize().cmp(&self.pubkey.serialize()))
157157
}
158158
}
159159

0 commit comments

Comments
 (0)