pub(crate) fn reduce_in_flight_count(&mut self, data_id: &T, reduce_by: usize) -> bool {
        let should_finish = if let Some(state) = self.current.get_mut(data_id) {
            state.in_flight_count = state.in_flight_count.saturating_sub(reduce_by);
            debug!(
                item=%data_id,
                in_flight_count=%state.in_flight_count,
                "reduced in-flight count for item"
            );
            state.in_flight_count == 0
        } else {
            false
        };

        if should_finish {
            debug!(item=%data_id, "finished gossiping since no more peers to gossip to");
            return self.force_finish(data_id);
        }

        false
    }
/// Directly reduces the in-flight count of gossip requests for the given item by the given
/// amount.
///
/// Returns `true` if there was a current entry for this data and it is now finished.
///
/// This should be called if, after trying to gossip to a given number of peers, we find that
/// we've not been able to select enough peers.  Without this reduction, the given gossip item
/// would never move from `current` to `finished`, and hence would never be purged.
Directly reduces the in-flight count of gossip requests for the given item by the given
amount.

Returns `true` if there was a current entry for this data and it is now finished.

This should be called if, after trying to gossip to a given number of peers, we find that
we've not been able to select enough peers.  Without this reduction, the given gossip item
would never move from `current` to `finished`, and hence would never be purged.
Directly reduces the in - flight count of gossip requests for the given item by the given amount . Returns ` true ` if there was a current entry for this data and it is now finished . This should be called if after trying to gossip to a given number of peers we find that we ' ve not been able to select enough peers . Without this reduction the given gossip item would never move from ` current ` to ` finished ` and hence would never be purged .
pub(crate) fn reduce_in_flight_count(&mut self, data_id: &T, reduce_by: usize) -> bool {
        let should_finish = if let Some(state) = self.current.get_mut(data_id) {
            state.in_flight_count = state.in_flight_count.saturating_sub(reduce_by);
            debug!(
                item=%data_id,
                in_flight_count=%state.in_flight_count,
                "reduced in-flight count for item"
            );
            state.in_flight_count == 0
        } else {
            false
        };
        if should_finish {
            debug!(item=%data_id, "finished gossiping since no more peers to gossip to");
            return self.force_finish(data_id);
        }
        false
    }
pub ( crate ) fn reduce_in_flight_count ( & mut self , data_id : & T , reduce_by : usize ) -> bool { let should_finish = if let Some ( state ) = self . current . get_mut ( data_id ) { state . in_flight_count = state . in_flight_count . saturating_sub ( reduce_by ) ; debug ! ( item data_id in_flight_count state in_flight_count " " ) ; state . in_flight_count == 0 } else { false } ; if should_finish { debug ! ( item data_id " " ) ; return self . force_finish ( data_id ) ; } false }
Directly reduces the in-flight count of gossip requests for the given item by the given
amount.
Directly reduces the in - flight count of gossip requests for the given item by the given amount .
&mut self
data_id
&T
reduce_by
usize
&mut self
data_id
&T
reduce_by
usize