We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f287cf6 commit 0389665Copy full SHA for 0389665
lightning/src/blinded_path/mod.rs
@@ -232,14 +232,9 @@ impl_writeable!(BlindedHop, {
232
impl Direction {
233
/// Returns the [`NodeId`] from the inputs corresponding to the direction.
234
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
- };
240
match self {
241
- Direction::NodeOne => node_one,
242
- Direction::NodeTwo => node_two,
+ Direction::NodeOne => core::cmp::min(node_a, node_b),
+ Direction::NodeTwo => core::cmp::max(node_a, node_b)
243
}
244
245
0 commit comments