From 3fcd2180e4e7060b78ca836b48a34901894502e4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 6 Oct 2019 14:05:37 -0400 Subject: bcat: Make ProgressServiceBackend's constructor take a std::string_view Given the string is appended to another, we can make it a view so a redundant full copy of the string isn't made. --- src/core/hle/service/bcat/backend/backend.cpp | 5 +++-- src/core/hle/service/bcat/backend/backend.h | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp index 2240f4047..7018d294a 100644 --- a/src/core/hle/service/bcat/backend/backend.cpp +++ b/src/core/hle/service/bcat/backend/backend.cpp @@ -10,10 +10,11 @@ namespace Service::BCAT { -ProgressServiceBackend::ProgressServiceBackend(std::string event_name) : impl{} { +ProgressServiceBackend::ProgressServiceBackend(std::string_view event_name) : impl{} { auto& kernel{Core::System::GetInstance().Kernel()}; event = Kernel::WritableEvent::CreateEventPair( - kernel, Kernel::ResetType::Automatic, "ProgressServiceBackend:UpdateEvent:" + event_name); + kernel, Kernel::ResetType::Automatic, + std::string("ProgressServiceBackend:UpdateEvent:").append(event_name)); } Kernel::SharedPtr ProgressServiceBackend::GetEvent() const { diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h index 762da94e3..05fd43e67 100644 --- a/src/core/hle/service/bcat/backend/backend.h +++ b/src/core/hle/service/bcat/backend/backend.h @@ -6,6 +6,9 @@ #include #include +#include +#include + #include "common/common_types.h" #include "core/file_sys/vfs_types.h" #include "core/hle/kernel/readable_event.h" @@ -85,7 +88,7 @@ public: void FinishDownload(ResultCode result); private: - explicit ProgressServiceBackend(std::string event_name); + explicit ProgressServiceBackend(std::string_view event_name); Kernel::SharedPtr GetEvent() const; DeliveryCacheProgressImpl& GetImpl(); -- cgit v1.2.3