[llvm] [Scalar] Use std::none_of (NFC) (PR #143282)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 7 12:17:04 PDT 2025
================
@@ -786,8 +786,7 @@ class ControlFlowHoister {
return InitialPreheader;
}
BranchInst *BI = It->first;
- assert(std::find_if(++It, HoistableBranches.end(), HasBBAsSuccessor) ==
- HoistableBranches.end() &&
+ assert(std::none_of(++It, HoistableBranches.end(), HasBBAsSuccessor) &&
----------------
huixie90 wrote:
out of interest, doesn't this code get different behaviour across Release and Debug build? there is side effect (`++It`) inside `assert`. depending on if NDebug is defined, `It` may or may not get incremented.
https://github.com/llvm/llvm-project/pull/143282
More information about the llvm-commits
mailing list