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 94affbe commit 1eed2adCopy full SHA for 1eed2ad
lightning/src/blinded_path/mod.rs
@@ -259,14 +259,9 @@ impl Direction {
259
260
/// Returns the [`PublicKey`] from the inputs corresponding to the direction.
261
pub fn select_pubkey<'a>(&self, node_a: &'a PublicKey, node_b: &'a PublicKey) -> &'a PublicKey {
262
- let (node_one, node_two) = if node_a < node_b {
263
- (node_a, node_b)
264
- } else {
265
- (node_b, node_a)
266
- };
267
match self {
268
- Direction::NodeOne => node_one,
269
- Direction::NodeTwo => node_two,
+ Direction::NodeOne => core::cmp::min(node_a, node_b),
+ Direction::NodeTwo => core::cmp::max(node_a, node_b)
270
}
271
272
0 commit comments