[host] nvfbc: optimize change detection loop

Before, we only break out of the current row when a change is detected,
and all subsequent rows are still scanned. Now we break out of the entire
loop. This should make change detection ever so slightly faster.
This commit is contained in:
Quantum 2021-07-10 19:07:43 -04:00 committed by Geoffrey McRae
parent fd8f8b2b28
commit 501b270890

View File

@ -305,9 +305,10 @@ static CaptureResult nvfbc_capture(void)
if (this->diffMap[(y*w)+x]) if (this->diffMap[(y*w)+x])
{ {
changed = true; changed = true;
break; goto done;
} }
done:
if (!changed) if (!changed)
return CAPTURE_RESULT_TIMEOUT; return CAPTURE_RESULT_TIMEOUT;