[all-commits] [llvm/llvm-project] d3f92e: [clang-tidy] add check to suggest replacement of n...

Sopy via All-commits all-commits at lists.llvm.org
Thu Apr 25 08:03:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d3f92e30bbd5c295a639f207b9ac92198d538fb3
      https://github.com/llvm/llvm-project/commit/d3f92e30bbd5c295a639f207b9ac92198d538fb3
  Author: Sopy <doimpt at sopy.one>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/CMakeLists.txt
    A clang-tools-extra/clang-tidy/modernize/MinMaxUseInitializerListCheck.cpp
    A clang-tools-extra/clang-tidy/modernize/MinMaxUseInitializerListCheck.h
    M clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst
    A clang-tools-extra/test/clang-tidy/checkers/modernize/min-max-use-initializer-list.cpp

  Log Message:
  -----------
  [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (#85572)

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.

Closes #25340



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list