mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-02 05:17:52 +00:00
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.
This commit is contained in:
parent
f2fa16b609
commit
3fcd2180e4
2 changed files with 7 additions and 3 deletions
|
@ -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<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() const {
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#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<Kernel::ReadableEvent> GetEvent() const;
|
||||
DeliveryCacheProgressImpl& GetImpl();
|
||||
|
|
Loading…
Reference in a new issue