Skip to content

Commit 077b718

Browse files
committed
f - use core::cmp::min/max
1 parent 5571499 commit 077b718

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
@@ -258,14 +258,9 @@ impl Direction {
258258

259259
/// Returns the [`PublicKey`] from the inputs corresponding to the direction.
260260
pub fn select_pubkey<'a>(&self, node_a: &'a PublicKey, node_b: &'a PublicKey) -> &'a PublicKey {
261-
let (node_one, node_two) = if node_a < node_b {
262-
(node_a, node_b)
263-
} else {
264-
(node_b, node_a)
265-
};
266261
match self {
267-
Direction::NodeOne => node_one,
268-
Direction::NodeTwo => node_two,
262+
Direction::NodeOne => core::cmp::min(node_a, node_b),
263+
Direction::NodeTwo => core::cmp::max(node_a, node_b)
269264
}
270265
}
271266
}

0 commit comments

Comments
 (0)