aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2014-09-06 14:06:37 -0400
committerGravatar bunnei <bunneidev@gmail.com>2014-09-06 14:06:37 -0400
commita1300865873541e532545088d2e65ec83ac69335 (patch)
tree02ff446be648599dcabe45958f9f9d4a1c0d911d
parent272a201d129ff10fdf0189b4c84aae5801640b28 (diff)
parentd30747efea01b61dba44abe50f2b7a9d8f9da3a5 (diff)
Merge pull request #93 from lioncash/ref
core: Pass string by reference in FetchFromPortName and DeleteService
-rw-r--r--src/core/hle/service/service.cpp4
-rw-r--r--src/core/hle/service/service.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index d3af2768..00ac1c9c 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -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;
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index cb1ecde3..c0e803bd 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -149,13 +149,13 @@ public:
void AddService(Interface* service);
/// Removes a service from the manager (does not delete it though)
- void DeleteService(std::string port_name);
+ void DeleteService(const std::string& port_name);
/// Get a Service Interface from its UID
Interface* FetchFromHandle(u32 uid);
/// Get a Service Interface from its port
- Interface* FetchFromPortName(std::string port_name);
+ Interface* FetchFromPortName(const std::string& port_name);
private: