ASDenysPetrov added a comment. @vsavchenko Many thanks for your feedback! I will make a new separate function for checking intersections considering all your suggestions along with the old quick `add` versions. I'll be more optimized.
================ Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:142 + ContainerType::size_type InsertIdx = 0; + for (auto it = Original.begin(), e = Original.end(); it != e; ++it) { + const llvm::APSInt &RFrom = it->From(); ---------------- vsavchenko wrote: > Is there a reason not to use range-based loop in this case? You are right. Working on restoring O(N) I been played with iterators, then found another solution, but forgot to return range-based loop back. Thnx. ================ Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:150 + if (!IsIntersected) { + auto One = APSIntType(From).getValue(1); + const bool isCurrentRangeOnTheLeft = RTo < From; ---------------- vsavchenko wrote: > This should be done outside of the loop, we assume that all the ranges are of > the same type. +1 I'll move it outside the loop. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new/ https://reviews.llvm.org/D99797 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits