Don't clone before borrowing

Clippy told us to change function parameters to references, but
wasn't able to then tell us that the clone() before borrowing
was superfluous. This patch removes those by hand.

No expectation of a performance improvement here, since we were
just cloning reference counts. Just removes a bunch of noise.
This commit is contained in:
Greg Fitzgerald
2018-07-13 13:32:20 -06:00
parent 8cf5620b87
commit 28af9a39b4
9 changed files with 28 additions and 23 deletions

View File

@ -195,7 +195,7 @@ impl FullNode {
let bank = Arc::new(bank);
let mut thread_hdls = vec![];
let rpu = Rpu::new(
&bank.clone(),
&bank,
node.sockets.requests,
node.sockets.respond,
exit.clone(),
@ -205,18 +205,18 @@ impl FullNode {
let blob_recycler = BlobRecycler::default();
let crdt = Arc::new(RwLock::new(Crdt::new(node.data).expect("Crdt::new")));
let (tpu, blob_receiver) = Tpu::new(
&bank.clone(),
&crdt.clone(),
&bank,
&crdt,
tick_duration,
node.sockets.transaction,
&blob_recycler.clone(),
&blob_recycler,
exit.clone(),
writer,
);
thread_hdls.extend(tpu.thread_hdls());
let window = FullNode::new_window(ledger_tail, entry_height, &crdt, &blob_recycler);
let ncp = Ncp::new(
&crdt.clone(),
&crdt,
window.clone(),
node.sockets.gossip,
node.sockets.gossip_send,
@ -278,7 +278,7 @@ impl FullNode {
let bank = Arc::new(bank);
let mut thread_hdls = vec![];
let rpu = Rpu::new(
&bank.clone(),
&bank,
node.sockets.requests,
node.sockets.respond,
exit.clone(),
@ -295,7 +295,7 @@ impl FullNode {
let window = FullNode::new_window(ledger_tail, entry_height, &crdt, &blob_recycler);
let ncp = Ncp::new(
&crdt.clone(),
&crdt,
window.clone(),
node.sockets.gossip,
node.sockets.gossip_send,
@ -304,7 +304,7 @@ impl FullNode {
let tvu = Tvu::new(
keypair,
bank.clone(),
&bank,
entry_height,
crdt.clone(),
window.clone(),