readability-use-std-min-max¶
Replaces certain conditional statements with equivalent calls to
std::min
or std::max
.
Note: This may impact performance in critical code due to potential
additional stores compared to the original if statement.
Before:
void foo() {
int a = 2, b = 3;
if (a < b)
a = b;
}
After:
void foo() {
int a = 2, b = 3;
a = std::max(a, b);
}