Because our router is rather large, LLVM doesn't always decide to
inline small functions in it, opting instead for a call. This is
somewhat wasteful when we do repeated `match`es on the same data,
so here we force inlining of the `source` and `target` `NodeId`
lookups.
/// Source node id refers to the node forwarding the HTLC through this hop.
///
/// For [`Self::FirstHop`] we return payer's node id.
- #[inline]
+ #[inline(always)]
pub fn source(&self) -> NodeId {
match self {
CandidateRouteHop::FirstHop(hop) => *hop.payer_node_id,
///
/// For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
/// and such a return value would be somewhat nonsensical.
- #[inline]
+ #[inline(always)]
pub fn target(&self) -> Option<NodeId> {
match self {
CandidateRouteHop::FirstHop(hop) => Some(hop.details.counterparty.node_id.into()),