mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-25 10:48:14 +00:00
[clangd] Fix subtle use after return.
I didn't find this because my main development machine still happens to use libstdc++ with the broken C++11 ABI, which has a global empty string. llvm-svn: 294309
This commit is contained in:
parent
8c0f62d293
commit
81f91c1777
@ -26,7 +26,10 @@ public:
|
||||
/// Delete a document from the store.
|
||||
void removeDocument(StringRef Uri) { Docs.erase(Uri); }
|
||||
/// Retrieve a document from the store. Empty string if it's unknown.
|
||||
StringRef getDocument(StringRef Uri) const { return Docs.lookup(Uri); }
|
||||
StringRef getDocument(StringRef Uri) const {
|
||||
auto I = Docs.find(Uri);
|
||||
return I == Docs.end() ? StringRef("") : StringRef(I->second);
|
||||
}
|
||||
|
||||
private:
|
||||
llvm::StringMap<std::string> Docs;
|
||||
|
Loading…
x
Reference in New Issue
Block a user