Modernize std::reverse with ranges

This commit is contained in:
mitaclaw 2024-09-28 20:20:31 -07:00
parent 9bd1dae41d
commit 78440ca335
4 changed files with 4 additions and 4 deletions

View File

@ -266,7 +266,7 @@ Common::Debug::Threads PPCDebugInterface::GetThreads(const Core::CPUThreadGuard&
const u32 prev_addr = active_thread->Data().thread_link.prev;
insert_threads(prev_addr, [](const auto& thread) { return thread.Data().thread_link.prev; });
std::reverse(threads.begin(), threads.end());
std::ranges::reverse(threads);
const u32 next_addr = active_thread->Data().thread_link.next;
threads.emplace_back(std::move(active_thread));

View File

@ -44,7 +44,7 @@ struct MPI : mbedtls_mpi
if (mbedtls_mpi_write_binary(this, out_data->data(), out_data->size()))
return false;
std::reverse(out_data->begin(), out_data->end());
std::ranges::reverse(*out_data);
return true;
}

View File

@ -598,7 +598,7 @@ void BluetoothRealDevice::LoadLinkKeys()
}
auto& mac = address.value();
std::reverse(mac.begin(), mac.end());
std::ranges::reverse(mac);
const std::string& key_string = pair.substr(index + 1);
linkkey_t key{};

View File

@ -660,7 +660,7 @@ bool PopulateConfig(GLContext* m_main_gl_context)
}
g_Config.backend_info.AAModes.push_back(1);
// The UI wants ascending order
std::reverse(g_Config.backend_info.AAModes.begin(), g_Config.backend_info.AAModes.end());
std::ranges::reverse(g_Config.backend_info.AAModes);
}
}
else