diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-12-10 12:24:19 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-12-10 12:24:19 +0000 |
commit | 12006c4eb78939386accfd7504da66a05ced093e (patch) | |
tree | 14f5d7448117bbc3e8f7c4ffe222114360bd031b | |
parent | a59a957ea22e0932a475fc759cfa4b4e26dca9cf (diff) |
[clang-tidy] Sort includes case-sensitively.
The motivation is:
1. consistency with clang-format, vim :sort etc.
2. we don't want the tools to depend on the current locale to do the include
sorting
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@255243 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | clang-tidy/utils/IncludeSorter.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/clang-tidy/utils/IncludeSorter.cpp b/clang-tidy/utils/IncludeSorter.cpp index d818dbbc..0b89e1c2 100644 --- a/clang-tidy/utils/IncludeSorter.cpp +++ b/clang-tidy/utils/IncludeSorter.cpp @@ -188,10 +188,7 @@ std::vector<FixItHint> IncludeSorter::GetEdits() { // delete inclusions. for (int IncludeKind = 0; IncludeKind < IK_InvalidInclude; ++IncludeKind) { std::sort(IncludeBucket[IncludeKind].begin(), - IncludeBucket[IncludeKind].end(), - [](const std::string &Left, const std::string &Right) { - return llvm::StringRef(Left).compare_lower(Right) < 0; - }); + IncludeBucket[IncludeKind].end()); for (const auto &IncludeEntry : IncludeBucket[IncludeKind]) { auto &Location = IncludeLocations[IncludeEntry]; SourceRangeVector::iterator LocationIterator = Location.begin(); |