Simplify BranchInst::getSuccessor, avoiding a conditional operator.

llvm-svn: 36991
This commit is contained in:
Dan Gohman 2007-05-11 20:59:29 +00:00
parent 2e4ac0dea5
commit fad75ac3af

View File

@ -1323,8 +1323,7 @@ public:
BasicBlock *getSuccessor(unsigned i) const {
assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
return (i == 0) ? cast<BasicBlock>(getOperand(0)) :
cast<BasicBlock>(getOperand(1));
return cast<BasicBlock>(getOperand(i));
}
void setSuccessor(unsigned idx, BasicBlock *NewSucc) {