If ParentWithSuccs is nullptr, the number of successors is guaranteed to
be 0. Simplify the code as suggested by @Ayal in D140511.
static VPAllSuccessorsIterator end(BlockPtrTy Block) {
BlockPtrTy ParentWithSuccs = getBlockWithSuccs(Block);
- unsigned NumSuccessors = ParentWithSuccs
- ? ParentWithSuccs->getNumSuccessors()
- : Block->getNumSuccessors();
+ unsigned NumSuccessors =
+ ParentWithSuccs ? ParentWithSuccs->getNumSuccessors() : 0;
if (auto *R = dyn_cast<VPRegionBlock>(Block))
return {R, NumSuccessors + 1};