Skip to content

Commit 55262b7

Browse files
committed
f: Cleanup max_length calculation
1 parent df06f55 commit 55262b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/blinded_path/payment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
293293
.chain(core::iter::once(BlindedPaymentTlvsRef::Receive(&payee_tlvs)));
294294

295295
let max_length = tlvs.clone()
296-
.max_by_key(|c| c.serialized_length())
297-
.map(|c| c.serialized_length())
296+
.map(|tlv| tlv.serialized_length())
297+
.max()
298298
.unwrap_or(0);
299299

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

0 commit comments

Comments
 (0)