Merge pull request #2222 from lioncash/cstr

service/service: Remove unncessary calls to c_str()
This commit is contained in:
bunnei 2019-03-12 17:54:20 -04:00 committed by GitHub
commit 0f6dd7b64e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,8 @@ namespace Service {
* Creates a function string for logging, complete with the name (or header code, depending * Creates a function string for logging, complete with the name (or header code, depending
* on what's passed in) the port name, and all the cmd_buff arguments. * on what's passed in) the port name, and all the cmd_buff arguments.
*/ */
[[maybe_unused]] static std::string MakeFunctionString(const char* name, const char* port_name, [[maybe_unused]] static std::string MakeFunctionString(std::string_view name,
std::string_view port_name,
const u32* cmd_buff) { const u32* cmd_buff) {
// Number of params == bits 0-5 + bits 6-11 // Number of params == bits 0-5 + bits 6-11
int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F); int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F);
@ -158,9 +159,7 @@ void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) {
return ReportUnimplementedFunction(ctx, info); return ReportUnimplementedFunction(ctx, info);
} }
LOG_TRACE( LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer()));
Service, "{}",
MakeFunctionString(info->name, GetServiceName().c_str(), ctx.CommandBuffer()).c_str());
handler_invoker(this, info->handler_callback, ctx); handler_invoker(this, info->handler_callback, ctx);
} }