diff options
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r-- | llvm/lib/Support/VirtualFileSystem.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 5febdf9..e489282 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -1708,11 +1708,12 @@ class llvm::vfs::RedirectingFileSystemParser { // false on error bool checkDuplicateOrUnknownKey(yaml::Node *KeyNode, StringRef Key, DenseMap<StringRef, KeyStatus> &Keys) { - if (!Keys.count(Key)) { + auto It = Keys.find(Key); + if (It == Keys.end()) { error(KeyNode, "unknown key"); return false; } - KeyStatus &S = Keys[Key]; + KeyStatus &S = It->second; if (S.Seen) { error(KeyNode, Twine("duplicate key '") + Key + "'"); return false; |