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
+1 -1
View File
@@ -261,7 +261,7 @@ void SdlInputHandler::raiseAllKeys()
"Raising %d keys",
(int)m_KeysDown.count());
for (auto keyDown : m_KeysDown) {
for (auto keyDown : std::as_const(m_KeysDown)) {
LiSendKeyboardEvent(keyDown, KEY_ACTION_UP, 0);
}
+1 -1
View File
@@ -1596,7 +1596,7 @@ bool Session::startConnectionAsync()
// the chosen resolution. Avoid that by disabling SOPS when it
// is not streaming a supported resolution.
enableGameOptimizations = false;
for (const NvDisplayMode &mode : m_Computer->displayModes) {
for (const NvDisplayMode &mode : std::as_const(m_Computer->displayModes)) {
if (mode.width == m_StreamConfig.width &&
mode.height == m_StreamConfig.height) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
+1 -1
View File
@@ -18,7 +18,7 @@ public:
{
int value = 0;
for (const int & v : *this) {
for (const int v : *this) {
value |= v;
}
@@ -213,7 +213,7 @@ void Pacer::handleVsync(int timeUntilNextVsyncMillis)
// frame history to drop frames only if consistently above the
// one queued frame mark.
if (m_MaxVideoFps >= m_DisplayFps) {
for (int queueHistoryEntry : m_PacingQueueHistory) {
for (int queueHistoryEntry : std::as_const(m_PacingQueueHistory)) {
if (queueHistoryEntry <= 1) {
// Be lenient as long as the queue length
// resolves before the end of frame history
@@ -360,7 +360,7 @@ void Pacer::renderFrame(AVFrame* frame)
}
else {
frameDropTarget = 0;
for (int queueHistoryEntry : m_RenderQueueHistory) {
for (int queueHistoryEntry : std::as_const(m_RenderQueueHistory)) {
if (queueHistoryEntry == 0) {
// Be lenient as long as the queue length
// resolves before the end of frame history