[clang] e266d6a - [Format] Use llvm::min_element (NFC) (#143725)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 11 12:50:14 PDT 2025
Author: Kazu Hirata
Date: 2025-06-11T12:50:11-07:00
New Revision: e266d6a5da6871c89747416c70a4a39181b594fb
URL: https://github.com/llvm/llvm-project/commit/e266d6a5da6871c89747416c70a4a39181b594fb
DIFF: https://github.com/llvm/llvm-project/commit/e266d6a5da6871c89747416c70a4a39181b594fb.diff
LOG: [Format] Use llvm::min_element (NFC) (#143725)
llvm::min_elements allows us to pass a range.
Added:
Modified:
clang/lib/Format/MacroCallReconstructor.cpp
Removed:
################################################################################
diff --git a/clang/lib/Format/MacroCallReconstructor.cpp b/clang/lib/Format/MacroCallReconstructor.cpp
index 116bbad320e1f..895d9f93dfce3 100644
--- a/clang/lib/Format/MacroCallReconstructor.cpp
+++ b/clang/lib/Format/MacroCallReconstructor.cpp
@@ -528,10 +528,10 @@ MacroCallReconstructor::createUnwrappedLine(const ReconstructedLine &Line,
// 1. One level below the current line's level.
// 2. At the correct level relative to each other.
unsigned MinChildLevel =
- std::min_element(N->Children.begin(), N->Children.end(),
- [](const auto &E1, const auto &E2) {
- return E1->Level < E2->Level;
- })
+ llvm::min_element(N->Children,
+ [](const auto &E1, const auto &E2) {
+ return E1->Level < E2->Level;
+ })
->get()
->Level;
for (const auto &Child : N->Children) {
More information about the cfe-commits
mailing list