fn update(&mut self,count:CountIndex,reason_finished:bool,froms:&[CandidateIndex],from_counts:&[CountIndex]) {
        self.count=count;
        let mut distributor = CandidateDistributor::new(self.num_candidates());
        for &from in froms {
            for from_count in from_counts {
                if let Some(pile) = self.piles_by_candidate[from.0].by_count.remove(from_count) {
                    for vote_index in pile {
                        self.votes.vote(vote_index).next(count,&self.continuing,&mut distributor,vote_index)
                    }
                }
            }
        }
        self.add(distributor,count);
        if reason_finished { // set aside any remaining votes for said candidate.
            for from in froms {
                for (_,votes) in self.piles_by_candidate[from.0].by_count.drain() {
                    for vote in votes {
                        self.votes.vote(vote).pile_status=PileStatus::SetAside;
                    }
                }
            }
        }
    }
/// Apply the count to all VoteStatus people.
/// Take all votes sitting on candidate from, and move them to the appropriate place.
Apply the count to all VoteStatus people.
Take all votes sitting on candidate from, and move them to the appropriate place.
Apply the count to all VoteStatus people . Take all votes sitting on candidate from and move them to the appropriate place .
fn update(&mut self,count:CountIndex,reason_finished:bool,froms:&[CandidateIndex],from_counts:&[CountIndex]) {
        self.count=count;
        let mut distributor = CandidateDistributor::new(self.num_candidates());
        for &from in froms {
            for from_count in from_counts {
                if let Some(pile) = self.piles_by_candidate[from.0].by_count.remove(from_count) {
                    for vote_index in pile {
                        self.votes.vote(vote_index).next(count,&self.continuing,&mut distributor,vote_index)
                    }
                }
            }
        }
        self.add(distributor,count);
        if reason_finished { // set aside any remaining votes for said candidate.
            for from in froms {
                for (_,votes) in self.piles_by_candidate[from.0].by_count.drain() {
                    for vote in votes {
                        self.votes.vote(vote).pile_status=PileStatus::SetAside;
                    }
                }
            }
        }
    }
fn update ( & mut self , count : CountIndex , reason_finished : bool , froms : & [ CandidateIndex ] , from_counts : & [ CountIndex ] ) { self . count = count ; let mut distributor = CandidateDistributor :: new ( self . num_candidates ( ) ) ; for & from in froms { for from_count in from_counts { if let Some ( pile ) = self . piles_by_candidate [ from . 0 ] . by_count . remove ( from_count ) { for vote_index in pile { self . votes . vote ( vote_index ) . next ( count , & self . continuing , & mut distributor , vote_index ) } } } } self . add ( distributor , count ) ; if reason_finished { // set aside any remaining votes for said candidate. for from in froms { for ( _ , votes ) in self . piles_by_candidate [ from . 0 ] . by_count . drain ( ) { for vote in votes { self . votes . vote ( vote ) . pile_status = PileStatus :: SetAside ; } } } } }
Apply the count to all VoteStatus people.
Apply the count to all VoteStatus people .
&mut self
count
CountIndex
reason_finished
bool
froms
&[CandidateIndex]
from_counts
&[CountIndex]
&mut self
count
CountIndex
reason_finished
bool
froms
&[CandidateIndex]
from_counts
&[CountIndex]