// turn a branch with all successors identical to a goto
turn a branch with all successors identical to a goto
turn a branch with all successors identical to a goto
fn simplify_branch(&mut self, terminator: &mut Terminator<'tcx>) -> bool {
        match terminator.kind {
            TerminatorKind::If { .. } |
            TerminatorKind::Switch { .. } |
            TerminatorKind::SwitchInt { .. } => {},
            _ => return false
        };
        let first_succ = {
            let successors = terminator.successors();
            if let Some(&first_succ) = terminator.successors().get(0) {
                if successors.iter().all(|s| *s == first_succ) {
                    self.pred_count[first_succ] -= (successors.len()-1) as u32;
                    first_succ
                } else {
                    return false
                }
            } else {
                return false
            }
        };
        debug!("simplifying branch {:?}", terminator);
        terminator.kind = TerminatorKind::Goto { target: first_succ };
        true
    }
fn simplify_branch ( & mut self , terminator : & mut Terminator < ' tcx > ) -> bool { match terminator . kind { TerminatorKind :: If { .. } | TerminatorKind :: Switch { .. } | TerminatorKind :: SwitchInt { .. } => { } , _ => return false } ; let first_succ = { let successors = terminator . successors ( ) ; if let Some ( & first_succ ) = terminator . successors ( ) . get ( 0 ) { if successors . iter ( ) . all ( | s | * s == first_succ ) { self . pred_count [ first_succ ] -= ( successors . len ( ) - 1 ) as u32 ; first_succ } else { return false } } else { return false } } ; debug ! ( " " terminator ) ; terminator . kind = TerminatorKind :: Goto { target : first_succ } ; true }
turn a branch with all successors identical to a goto
turn a branch with all successors identical to a goto
&mut self
terminator
&mut Terminator<'tcx>