llvm-project
llvm-project copied to clipboard
[clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists
closes #25340
Identifies cases where std::min
or std::max
is used to find the minimum or maximum value among more than two items through repeated calls. The check replaces these calls with a single call to std::min
or std::max
that uses an initializer list. This makes the code slightly more efficient.