Skip to content

Commit

Permalink
Pass reference instead of copy
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunwangs committed Oct 3, 2024
1 parent f7d7080 commit 3e4f03d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions turbine/src/retransmit_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn retransmit(
shred_deduper: &mut ShredDeduper<2>,
max_slots: &MaxSlots,
rpc_subscriptions: Option<&RpcSubscriptions>,
slot_status_notifier: Option<SlotStatusNotifier>,
slot_status_notifier: Option<&SlotStatusNotifier>,
) -> Result<(), RecvTimeoutError> {
const RECV_TIMEOUT: Duration = Duration::from_secs(1);
let mut shreds = shreds_receiver.recv_timeout(RECV_TIMEOUT)?;
Expand Down Expand Up @@ -420,7 +420,7 @@ pub fn retransmitter(
&mut shred_deduper,
&max_slots,
rpc_subscriptions.as_deref(),
slot_status_notifier.clone(),
slot_status_notifier.as_ref(),
) {
Ok(()) => (),
Err(RecvTimeoutError::Timeout) => (),
Expand Down Expand Up @@ -518,7 +518,7 @@ impl RetransmitStats {
feed: I,
root: Slot,
rpc_subscriptions: Option<&RpcSubscriptions>,
slot_status_notifier: Option<SlotStatusNotifier>,
slot_status_notifier: Option<&SlotStatusNotifier>,
) where
I: IntoIterator<Item = (Slot, RetransmitSlotStats)>,
{
Expand All @@ -536,7 +536,7 @@ impl RetransmitStats {
}
}

if let Some(slot_status_notifier) = &slot_status_notifier {
if let Some(slot_status_notifier) = slot_status_notifier {
if slot > root {
slot_status_notifier
.read()
Expand Down

0 comments on commit 3e4f03d

Please sign in to comment.