core: Pass string by reference in FetchFromPortName and DeleteService
This commit is contained in:
parent
5d95d038a0
commit
d30747efea
2 changed files with 4 additions and 4 deletions
|
@ -41,7 +41,7 @@ void Manager::AddService(Interface* service) {
|
|||
}
|
||||
|
||||
/// Removes a service from the manager, also frees memory
|
||||
void Manager::DeleteService(std::string port_name) {
|
||||
void Manager::DeleteService(const std::string& port_name) {
|
||||
Interface* service = FetchFromPortName(port_name);
|
||||
m_services.erase(std::remove(m_services.begin(), m_services.end(), service), m_services.end());
|
||||
m_port_map.erase(port_name);
|
||||
|
@ -54,7 +54,7 @@ Interface* Manager::FetchFromHandle(Handle handle) {
|
|||
}
|
||||
|
||||
/// Get a Service Interface from its port
|
||||
Interface* Manager::FetchFromPortName(std::string port_name) {
|
||||
Interface* Manager::FetchFromPortName(const std::string& port_name) {
|
||||
auto itr = m_port_map.find(port_name);
|
||||
if (itr == m_port_map.end()) {
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue