]> git.bitcoin.ninja Git - rust-lightning/commit
Use a `MessageSendEvent`-handling fn rather than a single lopp
authorMatt Corallo <git@bluematt.me>
Mon, 24 Jun 2024 20:21:08 +0000 (20:21 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 1 Oct 2024 16:49:38 +0000 (16:49 +0000)
commitd13f336d16485098cb1ab9b5bc7f838ca2216d77
tree89f3e7b483b5ae9f43de61a4c862265faee2654a
parent4147de2cf015ccb253b891cbe35b2f0de0d0a898
Use a `MessageSendEvent`-handling fn rather than a single lopp

Rather than building a single `Vec` of `MessageSendEvent`s to
handle then iterating over them, we move the body of the loop into
a lambda and run the loop twice. In some cases, this may save a
single allocation, but more importantly it sets us up for the next
commit, which needs to know from which handler the
`MessageSendEvent` it is processing came from.
lightning/src/ln/peer_handler.rs