Don't excessively check all output files for failures

This is really just an optimization, but I suspect the author of the code
assumed that the bitwise &= operator short-cicuits. (It doesn't). So this
patch should then fix the code to have the intended behavior.

We don't have to check for failures in the remaining output files once
we've found one. pullFiles() returns just a bool indicating if one of the
output files has a recorded fail, so checking the remaining output files
after the first found failure is just a waste (and ideally they should
contain the same failure (however, flaky tests might break this ideal)).

Drive-by fix.

Change-Id: I951e500a69198e7ed124be32199ac81bbddb9bf7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Jan Arve Sæther 2019-08-22 10:18:53 +02:00
parent 4300dccba5
commit 529b271520

View File

@ -409,7 +409,7 @@ static bool pullFiles()
return false;
}
auto checkerIt = g_options.checkFiles.find(it.key());
ret &= checkerIt != g_options.checkFiles.end() && checkerIt.value()(output);
ret = ret && checkerIt != g_options.checkFiles.end() && checkerIt.value()(output);
if (it.value() == QStringLiteral("-")){
fprintf(stdout, "%s", output.constData());
fflush(stdout);