From 6cb2a3525212e2ff9353b1eba238b9dcc79a2cdf Mon Sep 17 00:00:00 2001 From: irriden Date: Tue, 15 Aug 2023 20:50:20 +0000 Subject: [PATCH] remove unnecessary clone in looper --- broker/src/looper.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/broker/src/looper.rs b/broker/src/looper.rs index 36ea109..94f1465 100644 --- a/broker/src/looper.rs +++ b/broker/src/looper.rs @@ -168,8 +168,7 @@ impl SignerLoop { log::info!("SEND ON {}", topics::VLS); let (res_topic, res) = self.send_request_wait(topics::VLS, md)?; log::info!("GOT ON {}", res_topic); - let mut the_res = res.clone(); - if res_topic == topics::LSS_RES { + let the_res = if res_topic == topics::LSS_RES { // send reply to LSS to store muts let lss_reply = self.send_lss(res)?; log::info!("LSS REPLY LEN {}", &lss_reply.len()); @@ -180,8 +179,10 @@ impl SignerLoop { if res_topic2 != topics::VLS_RES { log::warn!("got a topic NOT on {}", topics::VLS_RES); } - the_res = res2; - } + res2 + } else { + res + }; // create reply bytes for CLN let reply = parser::raw_response_from_bytes(the_res, COUNTER.load(Ordering::Relaxed))?; // add to the sequence