From 028b1a34a99a03babb464834f15d069fe2074d55 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 30 Oct 2019 00:32:05 -0300 Subject: [PATCH] yuzu_cmd: Use string_view instead of string for extensions Avoids potential allocations due to the usage of std::string on strings that we know at compile time. Most of these might fit in SSO, but it adds complexity that can be easily avoided with string views. --- src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 075a7074f1..6fde694a2a 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -50,7 +50,7 @@ private: }; bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { - std::vector unsupported_ext; + std::vector unsupported_ext; if (!GLAD_GL_ARB_buffer_storage) unsupported_ext.push_back("ARB_buffer_storage"); @@ -73,8 +73,8 @@ bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { if (!GLAD_GL_ARB_depth_buffer_float) unsupported_ext.push_back("ARB_depth_buffer_float"); - for (const std::string& ext : unsupported_ext) - LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext); + for (const auto& extension : unsupported_ext) + LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", extension); return unsupported_ext.empty(); }