[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 08:42:01 PST 2024


================
@@ -0,0 +1,32 @@
+.. title:: clang-tidy - readability-use-std-min-max
+
+readability-use-std-min-max
+===========================
+
+Replaces certain conditional statements with equivalent ``std::min`` or
+``std::max`` expressions. Note: This may impact
+performance in critical code due to potential additional stores compared
+to the original if statement.
+
+
+Examples:
----------------
PiotrZSL wrote:

Not needed, remove duplicated empty line and 'Examples:', Before and after should be fine

https://github.com/llvm/llvm-project/pull/77816


More information about the cfe-commits mailing list