Common/SymbolDB: Use std::string_view where applicable
These strings are only used for comparison against other strings, so a string view can be used here.
This commit is contained in:
parent
9cf6ba13df
commit
936aa5dbaa
|
@ -63,7 +63,7 @@ void SymbolDB::Index()
|
|||
}
|
||||
}
|
||||
|
||||
Symbol* SymbolDB::GetSymbolFromName(const std::string& name)
|
||||
Symbol* SymbolDB::GetSymbolFromName(std::string_view name)
|
||||
{
|
||||
for (auto& func : m_functions)
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ Symbol* SymbolDB::GetSymbolFromName(const std::string& name)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<Symbol*> SymbolDB::GetSymbolsFromName(const std::string& name)
|
||||
std::vector<Symbol*> SymbolDB::GetSymbolsFromName(std::string_view name)
|
||||
{
|
||||
std::vector<Symbol*> symbols;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
@ -71,8 +72,8 @@ public:
|
|||
virtual Symbol* AddFunction(u32 start_addr) { return nullptr; }
|
||||
void AddCompleteSymbol(const Symbol& symbol);
|
||||
|
||||
Symbol* GetSymbolFromName(const std::string& name);
|
||||
std::vector<Symbol*> GetSymbolsFromName(const std::string& name);
|
||||
Symbol* GetSymbolFromName(std::string_view name);
|
||||
std::vector<Symbol*> GetSymbolsFromName(std::string_view name);
|
||||
Symbol* GetSymbolFromHash(u32 hash);
|
||||
std::vector<Symbol*> GetSymbolsFromHash(u32 hash);
|
||||
|
||||
|
|
Loading…
Reference in New Issue