Fixed key > gpu_names check

This commit is contained in:
aristocratos 2023-05-20 17:27:20 +02:00
parent 04ed16a9f6
commit 2e68c0b916

View file

@ -273,7 +273,7 @@ namespace Input {
atomic_wait(Runner::active);
Config::current_preset = -1;
auto key_i = std::stoi(key);
if (key_i-4u >= Gpu::gpu_names.size()) return;
if (std::cmp_greater(key_i-4, Gpu::gpu_names.size())) return;
Config::toggle_box(std::string("gpu") + (char)((key_i == 0 ? 10 : (key_i-5)) + '0'));
Draw::calcSizes();
Runner::run("all", false, true);