[clang-tools-extra] r276400 - [include-fixer] Fix faulty sort predicate.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 22 02:07:16 PDT 2016
Author: d0k
Date: Fri Jul 22 04:07:16 2016
New Revision: 276400
URL: http://llvm.org/viewvc/llvm-project?rev=276400&view=rev
Log:
[include-fixer] Fix faulty sort predicate.
Note the == on the last line, this isn't a strict-weak ordering.
Modified:
clang-tools-extra/trunk/include-fixer/IncludeFixerContext.cpp
Modified: clang-tools-extra/trunk/include-fixer/IncludeFixerContext.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/IncludeFixerContext.cpp?rev=276400&r1=276399&r2=276400&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/IncludeFixerContext.cpp (original)
+++ clang-tools-extra/trunk/include-fixer/IncludeFixerContext.cpp Fri Jul 22 04:07:16 2016
@@ -86,9 +86,8 @@ IncludeFixerContext::IncludeFixerContext
// triggered at the same position or unidentified symbol multiple times.
std::sort(QuerySymbolInfos.begin(), QuerySymbolInfos.end(),
[&](const QuerySymbolInfo &A, const QuerySymbolInfo &B) {
- if (A.Range.getOffset() != B.Range.getOffset())
- return A.Range.getOffset() < B.Range.getOffset();
- return A.Range.getLength() == B.Range.getLength();
+ return std::make_pair(A.Range.getOffset(), A.Range.getLength()) <
+ std::make_pair(B.Range.getOffset(), B.Range.getLength());
});
QuerySymbolInfos.erase(
std::unique(QuerySymbolInfos.begin(), QuerySymbolInfos.end(),
More information about the cfe-commits
mailing list