@@ -312,11 +312,11 @@ std::function<bool(llvm::StringRef)> headerFilter() {
312312
313313// Maps absolute path of each files of each compilation commands to the
314314// absolute path of the input file.
315- llvm::Expected<std::map<std::string, std::string>>
315+ llvm::Expected<std::map<std::string, std::string, std::less<> >>
316316mapInputsToAbsPaths (clang::tooling::CompilationDatabase &CDB,
317317 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
318318 const std::vector<std::string> &Inputs) {
319- std::map<std::string, std::string> CDBToAbsPaths;
319+ std::map<std::string, std::string, std::less<> > CDBToAbsPaths;
320320 // Factory.editedFiles()` will contain the final code, along with the
321321 // path given in the compilation database. That path can be
322322 // absolute or relative, and if it is relative, it is relative to the
@@ -395,8 +395,7 @@ int main(int argc, const char **argv) {
395395 if (Edit) {
396396 for (const auto &NameAndContent : Factory.editedFiles ()) {
397397 llvm::StringRef FileName = NameAndContent.first ();
398- if (auto It = CDBToAbsPaths->find (FileName.str ());
399- It != CDBToAbsPaths->end ())
398+ if (auto It = CDBToAbsPaths->find (FileName); It != CDBToAbsPaths->end ())
400399 FileName = It->second ;
401400
402401 const std::string &FinalCode = NameAndContent.second ;
0 commit comments