Skip to content

Commit 0389665

Browse files
committed
f - use core::cmp::min/max
1 parent f287cf6 commit 0389665

File tree

1 file changed

+2
-7
lines changed
  • lightning/src/blinded_path

1 file changed

+2
-7
lines changed

lightning/src/blinded_path/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,9 @@ impl_writeable!(BlindedHop, {
232232
impl Direction {
233233
/// Returns the [`NodeId`] from the inputs corresponding to the direction.
234234
pub fn select_node_id<'a>(&self, node_a: &'a NodeId, node_b: &'a NodeId) -> &'a NodeId {
235-
let (node_one, node_two) = if node_a < node_b {
236-
(node_a, node_b)
237-
} else {
238-
(node_b, node_a)
239-
};
240235
match self {
241-
Direction::NodeOne => node_one,
242-
Direction::NodeTwo => node_two,
236+
Direction::NodeOne => core::cmp::min(node_a, node_b),
237+
Direction::NodeTwo => core::cmp::max(node_a, node_b)
243238
}
244239
}
245240
}

0 commit comments

Comments
 (0)