Skip to content
Permalink
Browse files

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.
  • Loading branch information...
lioncash committed Jun 16, 2019
1 parent 9cf6ba1 commit 936aa5dbaa123f748a8e4c0297372f01616b8302
Showing with 5 additions and 4 deletions.
  1. +2 −2 Source/Core/Common/SymbolDB.cpp
  2. +3 −2 Source/Core/Common/SymbolDB.h
@@ -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 @@ class SymbolDB
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);

0 comments on commit 936aa5d

Please sign in to comment.
You can’t perform that action at this time.