Skip to content

Commit 6233678

Browse files
committed
f: Cleanup the max_length calculation
1 parent 5b2aaa4 commit 6233678

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/blinded_path/message.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
149149
.chain(core::iter::once(ControlTlvs::Receive(ReceiveTlvs{ context: Some(context) })));
150150

151151
let max_length = tlvs.clone()
152-
.max_by_key(|c| c.serialized_length())
153-
.map(|c| c.serialized_length())
152+
.map(|tlv| tlv.serialized_length())
153+
.max()
154154
.unwrap_or(0);
155155

156156
let length_tlvs = tlvs.map(|tlv| (max_length, tlv));

0 commit comments

Comments
 (0)