diff options
| author | 2018-08-07 08:19:24 -0400 | |
|---|---|---|
| committer | 2018-08-07 08:32:06 -0400 | |
| commit | 7e49881b7f604d1ee267f70405b74ddd9f913791 (patch) | |
| tree | d6eb446e073c099eda0dba61af4cca7cabeb123d | |
| parent | Merge pull request #931 from DarkLordZach/nca-as-drd (diff) | |
| download | yuzu-7e49881b7f604d1ee267f70405b74ddd9f913791.tar.gz yuzu-7e49881b7f604d1ee267f70405b74ddd9f913791.tar.xz yuzu-7e49881b7f604d1ee267f70405b74ddd9f913791.zip | |
nvflinger: Use std::string_view in OpenDisplay()
We don't need to use a std::string here, given all that's done is
comparing the character sequence against another. This allows passing
regular const char* without needing to heap allocate.
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 0bf51062c..e6848827e 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -43,7 +43,7 @@ NVFlinger::~NVFlinger() { | |||
| 43 | CoreTiming::UnscheduleEvent(composition_event, 0); | 43 | CoreTiming::UnscheduleEvent(composition_event, 0); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | u64 NVFlinger::OpenDisplay(const std::string& name) { | 46 | u64 NVFlinger::OpenDisplay(std::string_view name) { |
| 47 | LOG_WARNING(Service, "Opening display {}", name); | 47 | LOG_WARNING(Service, "Opening display {}", name); |
| 48 | 48 | ||
| 49 | // TODO(Subv): Currently we only support the Default display. | 49 | // TODO(Subv): Currently we only support the Default display. |
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index 2c908297b..73ad994db 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <string_view> | ||
| 8 | #include <boost/optional.hpp> | 9 | #include <boost/optional.hpp> |
| 9 | #include "core/hle/kernel/event.h" | 10 | #include "core/hle/kernel/event.h" |
| 10 | 11 | ||
| @@ -41,7 +42,7 @@ public: | |||
| 41 | ~NVFlinger(); | 42 | ~NVFlinger(); |
| 42 | 43 | ||
| 43 | /// Opens the specified display and returns the id. | 44 | /// Opens the specified display and returns the id. |
| 44 | u64 OpenDisplay(const std::string& name); | 45 | u64 OpenDisplay(std::string_view name); |
| 45 | 46 | ||
| 46 | /// Creates a layer on the specified display and returns the layer id. | 47 | /// Creates a layer on the specified display and returns the layer id. |
| 47 | u64 CreateLayer(u64 display_id); | 48 | u64 CreateLayer(u64 display_id); |