From 15ae783e1487666b5c84f2defdf566cb0435ad95 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 7 Mar 2014 21:35:40 +0000 Subject: [C++11] Convert sort predicates into lambdas. No functionality change. llvm-svn: 203289 --- clang/lib/AST/VTableBuilder.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'clang/lib/AST/VTableBuilder.cpp') diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index d975dbe3639..eb5fa328559 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -3244,10 +3244,6 @@ void MicrosoftVTableContext::computeVTablePaths(bool ForVBTables, Changed = rebucketPaths(Paths); } -static bool pathCompare(const VPtrInfo *LHS, const VPtrInfo *RHS) { - return LHS->MangledPath < RHS->MangledPath; -} - static bool extendPath(VPtrInfo *P) { if (P->NextBaseToMangle) { P->MangledPath.push_back(P->NextBaseToMangle); @@ -3265,7 +3261,10 @@ static bool rebucketPaths(VPtrInfoVector &Paths) { // ordering is based on pointers, but it doesn't change our output order. The // current algorithm is designed to match MSVC 2012's names. VPtrInfoVector PathsSorted(Paths); - std::sort(PathsSorted.begin(), PathsSorted.end(), pathCompare); + std::sort(PathsSorted.begin(), PathsSorted.end(), + [](const VPtrInfo *LHS, const VPtrInfo *RHS) { + return LHS->MangledPath < RHS->MangledPath; + }); bool Changed = false; for (size_t I = 0, E = PathsSorted.size(); I != E;) { // Scan forward to find the end of the bucket. -- cgit v1.2.3