From b0df09335cce3f4a2c49bf27d23de85a3c0113dc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 24 Nov 2018 00:04:07 -0500 Subject: service/sm: Take std::string by const reference in UnregisterService Avoids the need to create a copy of the std::string instance (potentially allocating). The only reason RegisterService takes its argument by value is because it's std::moved internally. --- src/core/hle/service/sm/sm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/service/sm/sm.cpp') diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index c1b2f33b9..9ca8483a5 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -63,7 +63,7 @@ ResultVal> ServiceManager::RegisterService return MakeResult>(std::move(server_port)); } -ResultCode ServiceManager::UnregisterService(std::string name) { +ResultCode ServiceManager::UnregisterService(const std::string& name) { CASCADE_CODE(ValidateServiceName(name)); const auto iter = registered_services.find(name); -- cgit v1.2.3