From cfd9f7d25b4c1aea49b4dc017990f12142b8302b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 25 Jan 2022 13:50:10 -0500 Subject: video_core/macro_hle: Return unique_ptr directly from GetHLEProgram() Same behavior, but less code and header dependencies. --- src/video_core/macro/macro.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/video_core/macro/macro.cpp') diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp index 0870a7687..0ae78a9e5 100644 --- a/src/video_core/macro/macro.cpp +++ b/src/video_core/macro/macro.cpp @@ -65,10 +65,9 @@ void MacroEngine::Execute(u32 method, const std::vector& parameters) { cache_info.lle_program = Compile(code); } - auto hle_program = hle_macros->GetHLEProgram(cache_info.hash); - if (hle_program.has_value()) { + if (auto hle_program = hle_macros->GetHLEProgram(cache_info.hash)) { cache_info.has_hle_program = true; - cache_info.hle_program = std::move(hle_program.value()); + cache_info.hle_program = std::move(hle_program); cache_info.hle_program->Execute(parameters, method); } else { cache_info.lle_program->Execute(parameters, method); -- cgit v1.2.3