diff options
| author | 2019-10-06 14:05:37 -0400 | |
|---|---|---|
| committer | 2019-10-06 15:38:09 -0400 | |
| commit | 3fcd2180e4e7060b78ca836b48a34901894502e4 (patch) | |
| tree | d743703f49c8eacbbbddf7eb8ddbc7616821d3cb /src | |
| parent | bcat: Make ProgressServiceBackend's GetEvent() const (diff) | |
| download | yuzu-3fcd2180e4e7060b78ca836b48a34901894502e4.tar.gz yuzu-3fcd2180e4e7060b78ca836b48a34901894502e4.tar.xz yuzu-3fcd2180e4e7060b78ca836b48a34901894502e4.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/bcat/backend/backend.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/bcat/backend/backend.h | 5 |
2 files changed, 7 insertions, 3 deletions
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 @@ | |||
| 10 | 10 | ||
| 11 | namespace Service::BCAT { | 11 | namespace Service::BCAT { |
| 12 | 12 | ||
| 13 | ProgressServiceBackend::ProgressServiceBackend(std::string event_name) : impl{} { | 13 | ProgressServiceBackend::ProgressServiceBackend(std::string_view event_name) : impl{} { |
| 14 | auto& kernel{Core::System::GetInstance().Kernel()}; | 14 | auto& kernel{Core::System::GetInstance().Kernel()}; |
| 15 | event = Kernel::WritableEvent::CreateEventPair( | 15 | event = Kernel::WritableEvent::CreateEventPair( |
| 16 | kernel, Kernel::ResetType::Automatic, "ProgressServiceBackend:UpdateEvent:" + event_name); | 16 | kernel, Kernel::ResetType::Automatic, |
| 17 | std::string("ProgressServiceBackend:UpdateEvent:").append(event_name)); | ||
| 17 | } | 18 | } |
| 18 | 19 | ||
| 19 | Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() const { | 20 | Kernel::SharedPtr<Kernel::ReadableEvent> 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 @@ | |||
| 6 | 6 | ||
| 7 | #include <functional> | 7 | #include <functional> |
| 8 | #include <optional> | 8 | #include <optional> |
| 9 | #include <string> | ||
| 10 | #include <string_view> | ||
| 11 | |||
| 9 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 10 | #include "core/file_sys/vfs_types.h" | 13 | #include "core/file_sys/vfs_types.h" |
| 11 | #include "core/hle/kernel/readable_event.h" | 14 | #include "core/hle/kernel/readable_event.h" |
| @@ -85,7 +88,7 @@ public: | |||
| 85 | void FinishDownload(ResultCode result); | 88 | void FinishDownload(ResultCode result); |
| 86 | 89 | ||
| 87 | private: | 90 | private: |
| 88 | explicit ProgressServiceBackend(std::string event_name); | 91 | explicit ProgressServiceBackend(std::string_view event_name); |
| 89 | 92 | ||
| 90 | Kernel::SharedPtr<Kernel::ReadableEvent> GetEvent() const; | 93 | Kernel::SharedPtr<Kernel::ReadableEvent> GetEvent() const; |
| 91 | DeliveryCacheProgressImpl& GetImpl(); | 94 | DeliveryCacheProgressImpl& GetImpl(); |