Force inlining source and target node id lookup in candidate hops
[rust-lightning] / lightning / src / routing / router.rs
index 75bd47fb91b5798a1d580a4343b1059b1c764fb9..eb01e466b9dcc4299bc4e16897977b87670d498f 100644 (file)
@@ -1405,7 +1405,7 @@ impl<'a> CandidateRouteHop<'a> {
        /// 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,
@@ -1424,7 +1424,7 @@ impl<'a> CandidateRouteHop<'a> {
        ///
        /// 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()),