Skip to content

Commit c1ddbf6

Browse files
f simplify iterator further
1 parent 8a7a479 commit c1ddbf6

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lightning/src/blinded_path/payment.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,7 @@ pub(super) fn compute_payinfo(
186186
cltv_expiry_delta = cltv_expiry_delta.checked_add(tlvs.payment_relay.cltv_expiry_delta).ok_or(())?;
187187

188188
let mut htlc_min_candidate = tlvs.payment_constraints.htlc_minimum_msat as u128;
189-
// Get an iterator over `(curr_hop_tlvs..last_intermediate_hop_tlvs]`.
190-
let next_nodes = intermediate_nodes.iter()
191-
.enumerate()
192-
.skip(idx + 1)
193-
.map(|(_, (_, tlvs))| tlvs);
194-
for node in next_nodes {
189+
for (_, node) in intermediate_nodes.iter().skip(idx + 1) {
195190
// The min htlc for a hop is that hop's htlc_minimum_msat minus the following hops' fees
196191
// because the sender will automatically include that following fee in the amount that this
197192
// hop forwards.

0 commit comments

Comments
 (0)