For loop shadows function argument
in core/data/interpolate_polefig.cpp
lines 252 and 303
In that threadfunction
i
is a function argument and also used as loop variable in a for loop. As far as I see this does not result in any problem because the function argument i
is only used before the loop. Still I think this should be changed by either a different (better) name for the function argument (preferable option) or by a different name for for variable inside the loop
void threadfunction(
OnePeakAllInfos* ret, OnePeakAllInfos const& ddirect, int i, TakesLongTime* progress,
QMutex* mutex)
{
...
std::vector<Mapped> itfs;
searchPoints(alpha, beta, avgRadius, direct, itfs);
...
int iEnd = itfs.size();
int iBegin = qMax(0, qMin(qRound(itfs.size() * (1. - threshold)), iEnd - 1));
...
for (int i = iBegin; i < iEnd; ++i) {
inten += itfs.at(i).valueAtKey<double>("intensity");
tth += itfs.at(i).valueAtKey<deg>("center");
fwhm += itfs.at(i).valueAtKey<double>("fwhm");
}