diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-28 22:23:45 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-10-10 00:53:48 -0700 |
| commit | 01d0bdf1bbb4ad3604a6d261b8648b870b1f0131 (patch) | |
| tree | a48e2c7bb02206366c3187c59cf0b5f09a4429d1 /Source/Core/VideoBackends/OGL/OGLConfig.cpp | |
| parent | ebf7cebc32ac9af28dc2383192b7b14f7aea134f (diff) | |
Modernize `std::is_sorted` with ranges
In OGLConfig.cpp, `std::views::reverse` is used rather than sorting using `std::ranges::greater` in order to parallel other instances of reverse iteration in the function.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLConfig.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLConfig.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.cpp b/Source/Core/VideoBackends/OGL/OGLConfig.cpp index 387333b898..f53d38645b 100644 --- a/Source/Core/VideoBackends/OGL/OGLConfig.cpp +++ b/Source/Core/VideoBackends/OGL/OGLConfig.cpp @@ -4,6 +4,7 @@ #include "VideoBackends/OGL/OGLConfig.h" #include <cstdio> +#include <ranges> #include <string> #include <string_view> @@ -585,7 +586,7 @@ bool PopulateConfig(GLContext* m_main_gl_context) glGetInternalformativ(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, colorInternalFormat, GL_SAMPLES, num_color_sample_counts, reinterpret_cast<GLint*>(color_aa_modes.data())); - ASSERT_MSG(VIDEO, std::is_sorted(color_aa_modes.rbegin(), color_aa_modes.rend()), + ASSERT_MSG(VIDEO, std::ranges::is_sorted(color_aa_modes | std::views::reverse), "GPU driver didn't return sorted color AA modes: [{}]", fmt::join(color_aa_modes, ", ")); } @@ -614,7 +615,7 @@ bool PopulateConfig(GLContext* m_main_gl_context) glGetInternalformativ(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, depthInternalFormat, GL_SAMPLES, num_depth_sample_counts, reinterpret_cast<GLint*>(depth_aa_modes.data())); - ASSERT_MSG(VIDEO, std::is_sorted(depth_aa_modes.rbegin(), depth_aa_modes.rend()), + ASSERT_MSG(VIDEO, std::ranges::is_sorted(depth_aa_modes | std::views::reverse), "GPU driver didn't return sorted depth AA modes: [{}]", fmt::join(depth_aa_modes, ", ")); } |
