[llvm] d140182 - [Support] Use a hetrogenous lookup with std::map (NFC) (#113075)

via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 20 10:42:56 PDT 2024


Author: Kazu Hirata
Date: 2024-10-20T10:42:53-07:00
New Revision: d1401822e2d2753bed3ac597a42cc0b261de40a4

URL: https://github.com/llvm/llvm-project/commit/d1401822e2d2753bed3ac597a42cc0b261de40a4
DIFF: https://github.com/llvm/llvm-project/commit/d1401822e2d2753bed3ac597a42cc0b261de40a4.diff

LOG: [Support] Use a hetrogenous lookup with std::map (NFC) (#113075)

Added: 
    

Modified: 
    llvm/lib/Support/VirtualFileSystem.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 928c0b5a24ed65..3e79ecf2fc7e35 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -750,7 +750,7 @@ class InMemoryFileAdaptor : public File {
 
 class InMemoryDirectory : public InMemoryNode {
   Status Stat;
-  std::map<std::string, std::unique_ptr<InMemoryNode>> Entries;
+  std::map<std::string, std::unique_ptr<InMemoryNode>, std::less<>> Entries;
 
 public:
   InMemoryDirectory(Status Stat)
@@ -766,7 +766,7 @@ class InMemoryDirectory : public InMemoryNode {
   UniqueID getUniqueID() const { return Stat.getUniqueID(); }
 
   InMemoryNode *getChild(StringRef Name) const {
-    auto I = Entries.find(Name.str());
+    auto I = Entries.find(Name);
     if (I != Entries.end())
       return I->second.get();
     return nullptr;


        


More information about the llvm-commits mailing list