From f3daecafeb532e830dc7f0643bf8ad84473b3f8b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Jul 2018 11:46:59 -0400 Subject: [PATCH] nvflinger: Emplace Display instances directly We can use emplace_back to construct the Display instances directly, instead of constructing them separately and copying them, avoiding the need to copy std::string and std::vector instances that are part of the Display struct. --- src/core/hle/service/nvflinger/nvflinger.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index d580f779e2..1fca1743da 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -23,15 +23,10 @@ constexpr u64 frame_ticks = static_cast(CoreTiming::BASE_CLOCK_RATE / SCREE NVFlinger::NVFlinger() { // Add the different displays to the list of displays. - Display default_{0, "Default"}; - Display external{1, "External"}; - Display edid{2, "Edid"}; - Display internal{3, "Internal"}; - - displays.emplace_back(default_); - displays.emplace_back(external); - displays.emplace_back(edid); - displays.emplace_back(internal); + displays.emplace_back(0, "Default"); + displays.emplace_back(1, "External"); + displays.emplace_back(2, "Edid"); + displays.emplace_back(3, "Internal"); // Schedule the screen composition events composition_event =