Skip to content

Commit 266c049

Browse files
committed
f: Cleanup the max_length calculation
1 parent 90bcbb2 commit 266c049

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
@@ -188,8 +188,8 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
188188
.chain(core::iter::once(ControlTlvs::Receive(ReceiveTlvs{ context: Some(context) })));
189189

190190
let max_length = tlvs.clone()
191-
.max_by_key(|c| c.serialized_length())
192-
.map(|c| c.serialized_length())
191+
.map(|tlv| tlv.serialized_length())
192+
.max()
193193
.unwrap_or(0);
194194

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

0 commit comments

Comments
 (0)