Fix Clazy range-loop-detach warnings

This commit is contained in:
Cameron Gutman
2026-01-26 21:00:07 -06:00
parent f5f06ae44e
commit d484ec3ac8
14 changed files with 42 additions and 35 deletions

View File

@@ -120,7 +120,7 @@ void AppModel::quitRunningApp()
bool AppModel::isAppCurrentlyVisible(const NvApp& app)
{
for (const NvApp& visibleApp : m_VisibleApps) {
for (const NvApp& visibleApp : std::as_const(m_VisibleApps)) {
if (app.id == visibleApp.id) {
return true;
}
@@ -156,7 +156,7 @@ void AppModel::updateAppList(QVector<NvApp> newList)
const NvApp& existingApp = m_VisibleApps.at(i);
bool found = false;
for (const NvApp& newApp : newVisibleList) {
for (const NvApp& newApp : std::as_const(newVisibleList)) {
if (existingApp.id == newApp.id) {
// If the data changed, update it in our list
if (existingApp != newApp) {
@@ -178,7 +178,7 @@ void AppModel::updateAppList(QVector<NvApp> newList)
}
// Process additions now
for (const NvApp& newApp : newVisibleList) {
for (const NvApp& newApp : std::as_const(newVisibleList)) {
int insertionIndex = m_VisibleApps.size();
bool found = false;

View File

@@ -218,7 +218,7 @@ void SdlGamepadKeyNavigation::onPollingTimerFired()
}
// Handle analog sticks by polling
for (auto gc : m_Gamepads) {
for (auto gc : std::as_const(m_Gamepads)) {
short leftX = SDL_GameControllerGetAxis(gc, SDL_CONTROLLER_AXIS_LEFTX);
short leftY = SDL_GameControllerGetAxis(gc, SDL_CONTROLLER_AXIS_LEFTY);
if (SDL_GetTicks() - m_LastAxisNavigationEventTime < AXIS_NAVIGATION_REPEAT_DELAY) {