ASDenysPetrov added a comment.

My propositions for the function `negate`.



================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:421
+  ContainerType Result;
+  Result.reserve(What.getMinValue() == MIN ? What.size() + 1 : What.size());
 
----------------
Here you can reuse `SampleValue` and simplify a bit this snippet.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:433-434
+    if (To == MAX) {
+      Result.insert(Result.end(), What.begin(), What.end());
+      return makePersistent(std::move(Result));
+    }
----------------
Here you can just move `What`. And after that you can do `Result.reserve`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86465/new/

https://reviews.llvm.org/D86465

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to