pub fn extract_all_ballots_separated_by_transfer_value(&'_ mut self) -> Vec<(TransferValue,(Tally,VotesWithSameTransferValue<'a>,PortionOfReasonBeingDoneThisCount))> {
        let mut helpers : HashMap<TransferValue,MergeVotesHelper<Tally>> = HashMap::default();
        for ((_,tv),(prov,votes)) in self.by_provenance.drain() {
            let helper = helpers.entry(tv.clone()).or_insert_with(||MergeVotesHelper::default());
            helper.add(tv,prov,votes);
        }
        let mut res : Vec<(TransferValue,(Tally,VotesWithSameTransferValue<'a>,PortionOfReasonBeingDoneThisCount))> = helpers.into_iter().map(|(tv,helper)|(tv,helper.extract())).collect();
        res.sort_unstable_by(|(a,_), (b,_)| b.cmp(a)); // sort highest to lowest.
        res
    }
/// Extracts all the ballots, adding all with same transfer value together. Sort highest to lowest.
/// Clears this object.
Extracts all the ballots, adding all with same transfer value together. Sort highest to lowest.
Clears this object.
Extracts all the ballots adding all with same transfer value together . Sort highest to lowest . Clears this object .
pub fn extract_all_ballots_separated_by_transfer_value(&'_ mut self) -> Vec<(TransferValue,(Tally,VotesWithSameTransferValue<'a>,PortionOfReasonBeingDoneThisCount))> {
        let mut helpers : HashMap<TransferValue,MergeVotesHelper<Tally>> = HashMap::default();
        for ((_,tv),(prov,votes)) in self.by_provenance.drain() {
            let helper = helpers.entry(tv.clone()).or_insert_with(||MergeVotesHelper::default());
            helper.add(tv,prov,votes);
        }
        let mut res : Vec<(TransferValue,(Tally,VotesWithSameTransferValue<'a>,PortionOfReasonBeingDoneThisCount))> = helpers.into_iter().map(|(tv,helper)|(tv,helper.extract())).collect();
        res.sort_unstable_by(|(a,_), (b,_)| b.cmp(a)); // sort highest to lowest.
        res
    }
pub fn extract_all_ballots_separated_by_transfer_value ( & ' _ mut self ) -> Vec < ( TransferValue , ( Tally , VotesWithSameTransferValue < ' a > , PortionOfReasonBeingDoneThisCount ) ) > { let mut helpers : HashMap < TransferValue , MergeVotesHelper < Tally > > = HashMap :: default ( ) ; for ( ( _ , tv ) , ( prov , votes ) ) in self . by_provenance . drain ( ) { let helper = helpers . entry ( tv . clone ( ) ) . or_insert_with ( | | MergeVotesHelper :: default ( ) ) ; helper . add ( tv , prov , votes ) ; } let mut res : Vec < ( TransferValue , ( Tally , VotesWithSameTransferValue < ' a > , PortionOfReasonBeingDoneThisCount ) ) > = helpers . into_iter ( ) . map ( | ( tv , helper ) | ( tv , helper . extract ( ) ) ) . collect ( ) ; res . sort_unstable_by ( | ( a , _ ) , ( b , _ ) | b . cmp ( a ) ) ; // sort highest to lowest. res }
Extracts all the ballots, adding all with same transfer value together.
Extracts all the ballots adding all with same transfer value together .
&'_ mut self
&'_ mut self