[Scalar] Use std::none_of (NFC) (#143282)

While I am at it, this patch replaces It with std::next(It) for clarity.

Note that It is not used after this point.
This commit is contained in:
Kazu Hirata
2025-06-08 01:34:32 -07:00
committed by GitHub
parent 6edfc6ce6c
commit 3e1931d7fe

View File

@@ -786,8 +786,8 @@ public:
return InitialPreheader;
}
BranchInst *BI = It->first;
assert(std::find_if(++It, HoistableBranches.end(), HasBBAsSuccessor) ==
HoistableBranches.end() &&
assert(std::none_of(std::next(It), HoistableBranches.end(),
HasBBAsSuccessor) &&
"BB is expected to be the target of at most one branch");
LLVMContext &C = BB->getContext();